From 45e7abdc9d8878ab160bfac114debfe8ab7eddd9 Mon Sep 17 00:00:00 2001 From: Titouan Mathis Date: Tue, 28 Nov 2023 22:26:13 +0100 Subject: [PATCH] Publish GitHub release on tag push --- .github/workflows/release.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 000000000..36e105d97 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,31 @@ +name: Release + +on: + push: + tags: ['*.*.*'] + +jobs: + release: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@master + - name: Is this a prerelease? + run: | + PRERELEASE=false + # Check release type + if [[ $GITHUB_REF_NAME =~ 'alpha' || $GITHUB_REF_NAME =~ 'beta' || $GITHUB_REF_NAME =~ 'rc' ]]; then + echo "This is a prerelease." + PRERELEASE=true + fi + echo "is_prerelease=$PRERELEASE" >> $GITHUB_ENV + - name: Create Release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: ${{ github.ref }} + release_name: v${{ github.ref_name }} + body: Please refer to [Changelog.md](https://github.com/${{ github.repository }}/blob/${{ github.ref_name }}/Changelog.md) for details. + draft: false + prerelease: ${{ env.is_prerelease }}