A GitHub Action for creating a GitHub Release with Assets and Changelog whenever a new Tag is pushed to the repository.
- Parse Tag to match Semantic Versioning.
- Upload build artifacts (assets) to the release.
- Add a changelog to the release.
- Add changes to
CHANGELOG.md
in the following format (according to keepachangelog.com):
## [3.1.0-rc.1] - 2019-12-21
### Added
- Feature A
- Feature B
- GitHub Actions as a CI system
- GitHub Release as an Artifactory system
### Changed
- User API
### Removed
- Previous CI build
- Previous Artifactory
- Tag a commit with Version (according to semver.org).
- Push and watch Git-Release publishing a Release on GitHub ;-)
- Change the workflow to be triggered on Tag Push:
- For example
'*'
or a more specific like'v*'
:
- For example
on:
push:
tags:
- 'v*'
- 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/darwin-amd64.zip
build/linux-amd64.zip
build/windows-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 (defaultfalse
).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
).ALLOW_EMPTY_CHANGELOG (true/false as string)
- Allow publishing a release without changelog (defaultfalse
).ALLOW_TAG_PREFIX (true/false as string)
- Allow prefix on version Tag, for examplev3.1.0
orrelease-3.1.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.
- Git Tag should be identical to Changelog Version in order for changes to be parsed properly. This does not include Tag Prefix like
release-*
. - This action is automatically built at Docker Hub, and tagged with
latest / v3 / v3.1 / v3.1.0
. You may lock to a certain version instead of using latest.
(Recommended to lock against a major version, for examplev3
) - Instead of using pre-built image, you may build it during the execution of your flow by changing
docker://antonyurchenko/git-release:latest
toanton-yurchenko/git-release@master
MIT © 2019-present Anton Yurchenko