diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index bb15291790b..f15ec94cdbb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,17 +2,33 @@ name: release on: push: - tags: - - v* + branches: + - 'master' + - '*-release' permissions: contents: read jobs: - release-notes: + check_tag: runs-on: ubuntu-latest + continue-on-error: true - if: github.repository_owner == 'visgl' && (github.ref == 'refs/heads/master' || endsWith(github.ref, '-release')) + steps: + - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + + - name: Get git tags (https://github.com/actions/checkout/issues/206) + run: git fetch --tags -f + + - name: Get version from git tag + run: git describe --exact-match HEAD | grep '^v' + + + release: + runs-on: ubuntu-latest + needs: check_tag + + if: github.repository_owner == 'visgl' && jobs.check_tag.result != 'success' env: ADMIN_TOKEN: ${{ secrets.ADMIN_TOKEN }}