Skip to content

Commit

Permalink
Uploading release artifacts
Browse files Browse the repository at this point in the history
  • Loading branch information
linsomniac committed Feb 23, 2024
1 parent db40faa commit 7d95b52
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ on:
release:
types: [released]

permissions:
contents: write

jobs:
deploy:
environment:
Expand All @@ -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:
Expand Down

0 comments on commit 7d95b52

Please sign in to comment.