1name: post-release 2on: 3 push: 4 tags: 5 - "v*" 6permissions: 7 contents: read 8 9jobs: 10 create-release: 11 permissions: 12 contents: write # for actions/create-release to create a release 13 name: create-release 14 runs-on: ubuntu-latest 15 outputs: 16 upload_url: ${{ steps.release.outputs.upload_url }} 17 release_version: ${{ env.RELEASE_VERSION }} 18 steps: 19 - name: Get the release version from the tag 20 shell: bash 21 if: env.RELEASE_VERSION == '' 22 run: | 23 # See: https://github.community/t5/GitHub-Actions/How-to-get-just-the-tag-name/m-p/32167/highlight/true#M1027 24 echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV 25 echo "version is: ${{ env.RELEASE_VERSION }}" 26 - name: Checkout repository 27 uses: actions/checkout@v3 28 with: 29 fetch-depth: 1 30 - name: Generate Release Notes 31 run: | 32 ./.github/workflows/release-notes.py --tag ${{ env.RELEASE_VERSION }} --output notes-${{ env.RELEASE_VERSION }}.md 33 cat notes-${{ env.RELEASE_VERSION }}.md 34 - name: Create GitHub release 35 id: release 36 uses: actions/create-release@v1 37 env: 38 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 39 with: 40 tag_name: ${{ env.RELEASE_VERSION }} 41 release_name: ${{ env.RELEASE_VERSION }} 42 body_path: notes-${{ env.RELEASE_VERSION }}.md 43