Update github upload-artifact to v4 (#419) #16
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: tagged-release | |
on: | |
push: | |
tags: | |
- "v[0-9].[0-9]+.[0-9]+" | |
jobs: | |
build-and-publish: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/[email protected] | |
- name: Setup python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
- name: Install Poetry | |
uses: snok/[email protected] | |
with: | |
version: 1.6.1 | |
virtualenvs-path: .venv | |
virtualenvs-create: true | |
virtualenvs-in-project: true | |
installer-parallel: false | |
- name: Restore poetry cache | |
if: success() && !env.ACT | |
uses: actions/cache@v3 | |
with: | |
path: $(poetry config cache-dir) | |
key: ubuntu-latest-poetry-${{ matrix.python-version }}-${{ hashFiles('**/pyproject.toml') }} | |
- name: Build | |
run: poetry build | |
- name: Upload a Build Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: dist | |
path: dist/ | |
- name: Publish | |
run: poetry publish | |
env: | |
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }} | |
release: | |
runs-on: ubuntu-latest | |
needs: build-and-publish | |
steps: | |
- name: Checkout | |
uses: actions/[email protected] | |
- name: Download the Build Artifacts | |
uses: actions/[email protected] | |
with: | |
name: dist | |
path: dist/ | |
- name: Set TAG | |
run: echo "TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | |
- name: Create release | |
run: | | |
gh release create ${{ env.TAG }} \ | |
dist/* \ | |
--title "${{ env.TAG }}" \ | |
--generate-notes \ | |
--draft | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |