Skip to content

Commit

Permalink
Merge pull request #180 from rmartin16/attest-packages
Browse files Browse the repository at this point in the history
Use new create package action with attestation
  • Loading branch information
freakboy3742 authored May 30, 2024
2 parents e1e15b4 + 8421a60 commit bfb1fe8
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 23 deletions.
28 changes: 19 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ on:
branches:
- main
workflow_call:
inputs:
attest-package:
description: "Create GitHub provenance attestation for the package."
default: "false"
type: string
outputs:
artifact-name:
description: "Name of the uploaded artifact; use for artifact retrieval."
Expand All @@ -20,12 +25,18 @@ jobs:
uses: beeware/.github/.github/workflows/towncrier-run.yml@main

package:
name: Python Package
name: Package Travertino
permissions:
id-token: write
contents: read
attestations: write
uses: beeware/.github/.github/workflows/python-package-create.yml@main
with:
attest: ${{ inputs.attest-package }}

unit-tests:
name: Python compatibility test
needs: [pre-commit, towncrier, package]
needs: [ pre-commit, towncrier, package ]
runs-on: ubuntu-latest
continue-on-error: ${{ matrix.experimental }}
strategy:
Expand Down Expand Up @@ -54,12 +65,11 @@ jobs:
name: ${{ needs.package.outputs.artifact-name }}
path: dist

- name: Install dev dependencies
run: |
# We don't actually want to install travertino;
# we just want the dev extras so we have a known version of tox.
python -m pip install $(ls dist/travertino-*.whl)[dev]
- name: Install Tox
uses: beeware/.github/.github/actions/install-requirement@main
with:
requirements: tox
extra: dev

- name: Test
run: |
tox -e py --installpkg dist/travertino-*.whl
run: tox -e py --installpkg dist/travertino-*.whl
5 changes: 4 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ on:

jobs:
ci:
name: CI
uses: ./.github/workflows/ci.yml
with:
attest-package: "true"

release:
name: Create Release
Expand All @@ -20,7 +23,7 @@ jobs:
steps:
- name: Set build variables
run: |
echo "VERSION=${GITHUB_REF_NAME#v}" >> $GITHUB_ENV
echo "VERSION=${GITHUB_REF_NAME#v}" | tee -a $GITHUB_ENV
- name: Set up Python
uses: actions/[email protected]
Expand Down
1 change: 1 addition & 0 deletions changes/180.misc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
``hynek/build-and-inspect-python-package`` is now used to create the Python package.
14 changes: 1 addition & 13 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ ignore =
W503,

[tox]
envlist = towncrier-check,pre-commit,package,py{38,39,310,311,312,313}
envlist = towncrier-check,pre-commit,py{38,39,310,311,312,313}
skip_missing_interpreters = true

[testenv:pre-commit]
Expand All @@ -39,15 +39,3 @@ deps =
commands =
check : python -m towncrier.check --compare-with origin/main
!check : python -m towncrier {posargs}

[testenv:package]
skip_install = True
depends =
towncrier-check
pre-commit
deps =
build==1.2.1
twine==5.1.0
commands =
python -m build . --outdir dist{/}
python -m twine check dist{/}*

0 comments on commit bfb1fe8

Please sign in to comment.