Skip to content

Merge pull request #213 from ymyzk/actions-pin #415

Merge pull request #213 from ymyzk/actions-pin

Merge pull request #213 from ymyzk/actions-pin #415

Workflow file for this run

name: Packaging
on:
# Make sure packaging process is not broken
push:
branches: [master]
pull_request:
# Make a package for release
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.13
- name: Install dependencies
run: python -m pip install --upgrade build
- name: Create packages
run: python -m build
- uses: actions/upload-artifact@v4
with:
name: tox-gh-actions-dist
path: dist
pypi-publish:
needs:
- build
runs-on: ubuntu-latest
if: github.event_name == 'release'
environment: pypi
permissions:
id-token: write # Required for using pypa/gh-actions-pypi-publish
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: tox-gh-actions-dist
path: dist
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # v1.12.4
github-release:
needs:
- build
runs-on: ubuntu-latest
if: github.event_name == 'release'
environment: release
permissions:
contents: write # Required for uploading artifacts to GitHub release
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: tox-gh-actions-dist
path: dist
- name: Upload artifacts to GitHub release
working-directory: ./dist
env:
GH_TOKEN: ${{ github.token }}
run: gh release upload "${{ github.event.release.tag_name }}" ./*