Skip to content

Commit

Permalink
🔧 Fix release job (#1253)
Browse files Browse the repository at this point in the history
build and publish in one go, rather than having to use upload/download between two jobs
  • Loading branch information
chrisjsewell authored Aug 28, 2024
1 parent c997649 commit 3665b04
Showing 1 changed file with 13 additions and 33 deletions.
46 changes: 13 additions & 33 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,44 +3,24 @@ on:
push:
tags:
- '[0-9].[0-9]+.[0-9]+'

jobs:
build:
name: Build packages
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.9
uses: actions/setup-python@v5
with:
python-version: 3.9
- name: install Poetry
run: python -m pip install poetry
- name: poetry build
run: poetry build
- uses: actions/upload-artifact@v4
with:
name: poetry_build
path: dist/
publish:

publish_oficial:
name: Publish on PyPi
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.9
name: Publish to PyPi
# needs: check
# if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: 3.9
- uses: actions/download-artifact@v4
with:
name: poetry_build
path: dist/
- name: Display structure of downloaded files
run: ls -R
# PyPi Release
python-version: "3.10"
- name: install Poetry
run: python -m pip install poetry
- name: poetry configure PyPI Token
run: poetry config pypi-token.pypi ${{ secrets.PYPI }}
- name: poetry publish PyPi
run: poetry publish
- name: poetry build and publish PyPi
run: poetry --build publish

0 comments on commit 3665b04

Please sign in to comment.