From 7d95b52abac3493946790e3543e1fb91332f4afa Mon Sep 17 00:00:00 2001 From: Sean Reifschneider Date: Thu, 22 Feb 2024 21:41:48 -0700 Subject: [PATCH] Uploading release artifacts --- .github/workflows/release.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 245dbc6..45c1574 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,9 +16,6 @@ on: release: types: [released] -permissions: - contents: write - jobs: deploy: environment: @@ -27,30 +24,37 @@ jobs: runs-on: ubuntu-latest permissions: id-token: write + contents: write steps: - uses: actions/checkout@v4 + - name: Set up Python uses: actions/setup-python@v5 with: python-version: '3.x' + - name: Install dependencies run: | python -m pip install --upgrade pip pip install build + - name: Extract version from tag run: echo "RELEASE_VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV + - name: Update version in pyproject.toml run: | sed -i "s/version = \".*\"/version = \"${RELEASE_VERSION}\"/" pyproject.toml + - name: Build package run: python -m build + - name: Publish package uses: pypa/gh-action-pypi-publish@release/v1 with: password: ${{ secrets.PYPI_API_TOKEN }} + - name: Upload Release Asset uses: softprops/action-gh-release@v1 - if: github.event_name == 'release' && github.event.action == 'released' with: files: dist/* env: