Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Use PyPI trusted publishing #50

Merged
merged 3 commits into from
Apr 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 17 additions & 8 deletions .github/workflows/pypi-publish.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
name: Publish Python Package

on:
push:
branches:
- main
tags:
- 'v*'

workflow_dispatch:
inputs:
publish:
Expand All @@ -16,10 +10,15 @@ on:

jobs:
publish:
environment: release
runs-on: ubuntu-latest
permissions:
id-token: write
contents: write
packages: write

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0

Expand All @@ -28,6 +27,7 @@ jobs:
id: semver
uses: ietf-tools/semver-action@v1
with:
patchList: fix, bugfix, perf, refactor, test, tests, chore, revert
token: ${{ github.token }}
branch: main

Expand Down Expand Up @@ -70,7 +70,7 @@ jobs:
fi

- name: Setup Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.10'

Expand Down Expand Up @@ -143,3 +143,12 @@ jobs:
setup.cfg
svgcheck/__init__.py
dist/*.tar.gz

- name: Publish to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/

- name: Publish to PyPI
if: env.SHOULD_DEPLOY == 'true'
uses: pypa/gh-action-pypi-publish@release/v1
Loading