Skip to content

Create Release

Create Release #30

name: Create Release
env:
MILESTONE: ${{ github.event.milestone.title }}
on:
milestone:
types:
- closed
jobs:
wait-for-status-checks:
name: Wait for status checks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: sleep 13
- name: 'Wait for status checks'
id: waitforstatuschecks
uses: "WyriHaximus/github-action-wait-for-status@master"
with:
ignoreActions: "Wait for status checks"
checkInterval: 5
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
- id: generate-version-strategy
if: steps.waitforstatuschecks.outputs.status != 'success'
name: Fail
run: exit 1
generate-changelog:
name: Generate Changelog
needs:
- wait-for-status-checks
runs-on: ubuntu-latest
outputs:
changelog: ${{ steps.changelog.outputs.changelog }}
steps:
- name: Generate changelog
uses: WyriHaximus/github-action-jwage-changelog-generator@v1
id: changelog
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
milestone: ${{ env.MILESTONE }}
- name: Show changelog
run: echo "${CHANGELOG}"
env:
CHANGELOG: ${{ steps.changelog.outputs.changelog }}
create-release:
name: Create Release
needs:
- generate-changelog
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
env:
CHANGELOG: ${{ needs.generate-changelog.outputs.changelog }}
- run: |
echo -e "${MILESTONE_DESCRIPTION}\r\n\r\n${CHANGELOG}" > release-${{ env.MILESTONE }}-release-message.md
cat release-${{ env.MILESTONE }}-release-message.md
release_message=$(cat release-${{ env.MILESTONE }}-release-message.md)
release_message="${release_message//'%'/'%25'}"
release_message="${release_message//$'\n'/'%0A'}"
release_message="${release_message//$'\r'/'%0D'}"
echo "::set-output name=release_message::$release_message"
id: releasemessage
env:
MILESTONE_DESCRIPTION: ${{ github.event.milestone.description }}
CHANGELOG: ${{ needs.generate-changelog.outputs.changelog }}
- name: Create Reference Release with Changelog
uses: fleskesvor/create-release@feature/support-target-commitish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.MILESTONE }}
release_name: ${{ env.MILESTONE }}
body: ${{ steps.releasemessage.outputs.release_message }}
draft: false
prerelease: false