Skip to content
Use this GitHub Action with your project

Add this Action to an existing workflow or create a new one.

View on Marketplace
master
Go to file
Code

README.md

git-release

Release codecov Go Report Card Tests Docker Build Docker Pulls License

A GitHub Action for creating a GitHub Release with Assets and Changelog whenever a new Tag is pushed to the repository.

PIC

Features

  • Parse Tag to match Semantic Versioning
  • Upload build artifacts (assets) to the release
  • Add a changelog to the release
  • Linux/Windows runners supported
  • Filename pattern matching

Manual

  1. Add changes to CHANGELOG.md according to keepachangelog.com. For example:
## [3.4.0] - 2020-07-10
### Added
- Glob pattern support
- Unit Tests
- Log version

### Fixed
- Exception on margins larger than context of changelog
- Nil pointer exception in 'release' package

### Changed
- Refactor JavaScript wrapper

## [3.3.0] - 2020-06-27
### Added
- Wrapper script: allow execution on Windows runners

### Changed
- Action execution through Git: from Docker to NodeJS

[3.4.0]: https://github.com/anton-yurchenko/git-release/compare/v3.3.0...v3.4.0
[3.3.0]: https://github.com/anton-yurchenko/git-release/releases/tag/v3.3.0
  1. Tag a commit with Version (according to semver.org).
  2. Push and watch Git-Release publishing a Release on GitHub 😉
    PIC

Configuration

  1. Change the workflow to be triggered on Tag Push:
    • For example '*' or a more specific like 'v*':
on:
  push:
    tags:
    - 'v*'
  1. Add Release step to your workflow:
    - name: Release
      uses: docker://antonyurchenko/git-release:latest
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        DRAFT_RELEASE: "false"
        PRE_RELEASE: "false"
        CHANGELOG_FILE: "CHANGELOG.md"
        ALLOW_EMPTY_CHANGELOG: "false"
        ALLOW_TAG_PREFIX: "true"
      with:
        args: |
            build/*-amd64.zip
ℹ️ All Configuration Options
  • Provide a list of assets as args (divided by one of: new line, space, comma, pipe)
  • DRAFT_RELEASE (true/false as string) - Save release as draft instead of publishing it (default false).
  • PRE_RELEASE (true/false as string) - GitHub will point out that this release is identified as non-production ready (default: false).
  • CHANGELOG_FILE (string) - Changelog filename (default: CHANGELOG.md).
    • set to none in order to completely ignore changelog.
  • ALLOW_EMPTY_CHANGELOG (true/false as string) - Allow publishing a release without changelog (default false).
  • ALLOW_TAG_PREFIX (true/false as string) - Allow prefix on version Tag, for example v3.2.0 or release-3.2.0 (default: false).
  • RELEASE_NAME (string) - Complete release title (may not be combined with PREFIX or POSTFIX).
  • RELEASE_NAME_PREFIX (string) - Release title prefix.
  • RELEASE_NAME_POSTFIX (string) - Release title postfix.
ℹ️ Windows Runners

Execute git-release through JavaScrip Wrapper on Windows Runners.

Example:

    - name: Release
      uses: anton-yurchenko/git-release@master
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        DRAFT_RELEASE: "false"
        PRE_RELEASE: "false"
        CHANGELOG_FILE: "CHANGELOG.md"
        ALLOW_EMPTY_CHANGELOG: "false"
        ALLOW_TAG_PREFIX: "true"
      with:
        args: |
            build\\darwin-amd64.zip
            build\\linux-amd64.zip
            build\\windows-amd64.zip

ℹ️ Configuration Examples

Remarks

  • Git Tag should be identical to Changelog Version (without prefixes), for example tag v1.0.0 and changelog version 1.0.0.
  • This action is automatically built at Docker Hub, and tagged with latest / v3 / v3.4 / v3.4.1. You may lock to a certain version instead of using latest.
    (Recommended to lock against a major version, for example v3)
  • Instead of using a pre-built Docker image, you may execute the action through JavaScript wrapper by changing docker://antonyurchenko/git-release:latest to anton-yurchenko/git-release@master

License

MIT © 2019-present Anton Yurchenko

You can’t perform that action at this time.