diff --git a/.github/workflows/new_version.yml b/.github/workflows/new_version.yml index 1d5ccde..07fea8f 100644 --- a/.github/workflows/new_version.yml +++ b/.github/workflows/new_version.yml @@ -47,21 +47,22 @@ jobs: run: | poetry install poetry run pytest + - name: Package version + run: echo "VERSION=$(poetry version -s)" >> $GITHUB_ENV - name: Package version vs Git tag - run: | - echo "SEM_VER=$(poetry version -s)" >> $GITHUB_ENV - echo "GIT_TAG=$(git describe)" >> $GITHUB_ENV - test $SEM_VER = $GIT_TAG + if: ${{ !endsWith(github.ref, env.VERSION) }} + run: exit 1 + - release: - runs-on: ubuntu-latest - after: [docs, test] - steps: - - uses: actions/checkout@v2 - - name: Release - uses: softprops/action-gh-release@v1 - with: - draft: true - body_path: README.md - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + release: + runs-on: ubuntu-latest + needs: [docs, test] + steps: + - uses: actions/checkout@v2 + - name: Release + uses: softprops/action-gh-release@v1 + with: + draft: true + body_path: README.md + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file