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

build: test signing #73

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Python Package
name: Publish

on:
push:
Expand Down Expand Up @@ -29,22 +29,19 @@ jobs:
if-no-files-found: error
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')

publish:
pypi:
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
environment: release
permissions:
id-token: write
needs: build
steps:
- name: Install poetry
run: pipx install poetry

- uses: actions/download-artifact@v4
with:
name: package

- run: ls dist/*

- name: Publish package
run: poetry publish
env:
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }}
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
36 changes: 36 additions & 0 deletions .github/workflows/sign-commit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
on:
push:
branches:
- test-commit-signing

jobs:
sign-commit:
runs-on: ubuntu-latest
environment: release
steps:
- name: Check out
uses: actions/checkout@v3
with:
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}

- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v6
id: gpg-import
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
git_user_signingkey: true
git_commit_gpgsign: true
git_tag_gpgsign: true
fingerprint: 2B939A343491740FE1483E5C41E311388E4BB349

- name: List keys
run: gpg -K

- run: |
echo "Hello there" | tee change.file
git add change.file
git commit -m "changed a file"

- name: Verify commit signature
run: git verify-commit HEAD
Loading
Loading