redefine it in terms of which init system is used, not which operatin… #5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: changelog and release automation | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
changelog: | |
runs-on: ubuntu-latest | |
if: "!contains(github.event.head_commit.message, '[RELEASE]')" | |
steps: | |
- uses: actions/checkout@master | |
- name: calculate next version | |
id: version | |
uses: patrickjahns/version-drafter-action@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: update changelog | |
uses: patrickjahns/chlgr@v1 | |
with: | |
release-version: ${{ steps.version.outputs.next-version }} | |
release: | |
runs-on: ubuntu-latest | |
if: "contains(github.event.head_commit.message, '[RELEASE]')" | |
steps: | |
- uses: actions/checkout@master | |
- name: extract version from commit message | |
shell: bash | |
run: | | |
VERSION=$(echo "${COMMIT_MSG}" | grep -Po '\d+.\d+.\d+') | |
CHANGELOG=$(cat CHANGELOG.md | sed -n '/^## \[/{p; :loop n; /^## \[/q; p; b loop}') | |
CHANGELOG="${CHANGELOG%??}" | |
CHANGELOG="${CHANGELOG//'%'/'%25'}" | |
CHANGELOG="${CHANGELOG//$'\n'/'%0A'}" | |
CHANGELOG="${CHANGELOG//$'\r'/'%0D'}" | |
echo "version=${VERSION}" >> $GITHUB_OUTPUT | |
echo "changelog=${CHANGELOG}" >> $GITHUB_OUTPUT | |
env: | |
COMMIT_MSG: ${{ github.event.head_commit.message }} | |
id: version | |
- name: create release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
RELEASE_TAG: ${{ steps.version.outputs.version }} | |
RELASE_NOTES: ${{ steps.version.outputs.changelog }} | |
run: | | |
RELASE_NOTES="${RELASE_NOTES//$'%0A'/'\n'}" | |
echo -e $RELASE_NOTES | gh release create "${RELEASE_TAG}" --title "${RELEASE_TAG}" --notes-file - | |
- name: galaxy | |
uses: robertdebock/[email protected] | |
with: | |
galaxy_api_key: ${{ secrets.galaxy_api_key }} |