From e797ed3f35be777ebb056c95494bcd47512956cd Mon Sep 17 00:00:00 2001 From: Artem Rys Date: Mon, 24 Jul 2023 23:46:59 +0200 Subject: [PATCH] ci: release according to the latest standards --- .github/workflows/build-test-release.yml | 14 +++++++++++--- .github/workflows/sr-prepare.sh | 5 ----- .github/workflows/sr-release.sh | 6 ------ .releaserc | 3 --- 4 files changed, 11 insertions(+), 17 deletions(-) delete mode 100755 .github/workflows/sr-prepare.sh delete mode 100755 .github/workflows/sr-release.sh diff --git a/.github/workflows/build-test-release.yml b/.github/workflows/build-test-release.yml index 220ff22..069ebae 100644 --- a/.github/workflows/build-test-release.yml +++ b/.github/workflows/build-test-release.yml @@ -84,11 +84,19 @@ jobs: curl -sSL https://install.python-poetry.org | python3 - --version 1.4.2 poetry install poetry build - - uses: splunk/semantic-release-action@v1.3 + - id: semantic + uses: splunk/semantic-release-action@v1.3 with: + git_committer_name: ${{ secrets.SA_GH_USER_NAME }} + git_committer_email: ${{ secrets.SA_GH_USER_EMAIL }} + gpg_private_key: ${{ secrets.SA_GPG_PRIVATE_KEY }} + passphrase: ${{ secrets.SA_GPG_PASSPHRASE }} extra_plugins: | @google/semantic-release-replace-plugin env: GITHUB_TOKEN: ${{ secrets.GH_TOKEN_ADMIN }} - PYPI_USERNAME: ${{ secrets.PYPI_USERNAME }} - PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} + - if: ${{ steps.semantic.outputs.new_release_published == 'true' }} + uses: splunk/pypi-publish-action@v1.0 + with: + pypi_username: ${{ secrets.PYPI_USERNAME }} + pypi_token: ${{ secrets.PYPI_TOKEN }} diff --git a/.github/workflows/sr-prepare.sh b/.github/workflows/sr-prepare.sh deleted file mode 100755 index 2177b1d..0000000 --- a/.github/workflows/sr-prepare.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env bash - -set -eE -set -v -poetry build diff --git a/.github/workflows/sr-release.sh b/.github/workflows/sr-release.sh deleted file mode 100755 index 2c6f2f9..0000000 --- a/.github/workflows/sr-release.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env bash - -set -eE -set -v -echo pypy user=${PYPI_USERNAME} -poetry publish -n -u ${PYPI_USERNAME} -p ${PYPI_TOKEN} diff --git a/.releaserc b/.releaserc index bcd8dfa..5a2cb7b 100644 --- a/.releaserc +++ b/.releaserc @@ -47,9 +47,6 @@ [ "@semantic-release/exec", { - "prepareCmd": "./.github/workflows/sr-prepare.sh ${nextRelease.version}", - "publishCmd": "./.github/workflows/sr-release.sh", - "shell": "bash", "verifyReleaseCmd": "echo \"version=${nextRelease.version}\" >> $GITHUB_OUTPUT", "successCmd": "echo \"new_release_published=${'true'}\" >> $GITHUB_OUTPUT" },