Skip to content

Commit 2c5ef20

Browse files
authored
Merge pull request #474 from rmartin16/attest-package
Use new create package action with attestation
2 parents aad803d + a5e5d25 commit 2c5ef20

File tree

4 files changed

+35
-25
lines changed

4 files changed

+35
-25
lines changed

.github/workflows/ci.yml

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,28 @@ on:
55
branches:
66
- main
77
workflow_call:
8+
inputs:
9+
attest-package:
10+
description: "Create GitHub provenance attestation for the package."
11+
default: "false"
12+
type: string
813
outputs:
914
artifact-name:
1015
description: "Name of the uploaded artifact; use for artifact retrieval."
1116
value: ${{ jobs.package.outputs.artifact-name }}
1217

1318
# Cancel active CI runs for a PR before starting another run
1419
concurrency:
15-
group: ${{ github.ref }}
20+
group: ${{ github.workflow }}-${{ github.ref }}
1621
cancel-in-progress: true
1722

23+
defaults:
24+
run:
25+
shell: bash
26+
27+
env:
28+
FORCE_COLOR: "1"
29+
1830
jobs:
1931
pre-commit:
2032
name: Pre-commit checks
@@ -29,14 +41,18 @@ jobs:
2941
runner-os: "macos-latest"
3042

3143
package:
32-
name: Python Package
44+
name: Package Rubicon-ObjC
45+
permissions:
46+
id-token: write
47+
contents: read
48+
attestations: write
3349
uses: beeware/.github/.github/workflows/python-package-create.yml@main
3450
with:
35-
runner-os: "macos-latest"
51+
attest: ${{ inputs.attest-package }}
3652

3753
unit-tests:
3854
name: Unit tests
39-
needs: [pre-commit, towncrier, package]
55+
needs: [ pre-commit, towncrier, package ]
4056
runs-on: ${{ matrix.platform }}
4157
continue-on-error: ${{ matrix.experimental }}
4258
strategy:
@@ -79,12 +95,11 @@ jobs:
7995
name: ${{ needs.package.outputs.artifact-name }}
8096
path: dist
8197

82-
- name: Install dev dependencies
83-
run: |
84-
# We don't actually want to install rubicon;
85-
# we just want the dev extras so we have a known version of tox.
86-
python -m pip install $(ls dist/rubicon_objc-*.whl)[dev]
98+
- name: Install Tox
99+
uses: beeware/.github/.github/actions/install-requirement@main
100+
with:
101+
requirements: tox
102+
extra: dev
87103

88104
- name: Test
89-
run: |
90-
tox -e py --installpkg dist/rubicon_objc-*.whl
105+
run: tox -e py --installpkg dist/rubicon_objc-*.whl

.github/workflows/release.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@ on:
77

88
jobs:
99
ci:
10+
name: CI
1011
uses: ./.github/workflows/ci.yml
12+
with:
13+
attest-package: "true"
1114

1215
docs:
1316
name: Verify Docs Build
@@ -19,15 +22,15 @@ jobs:
1922

2023
release:
2124
name: Create Release
22-
needs: ci
25+
needs: [ ci, docs ]
2326
# This has to be run on macOS, because rubicon tries to load the Foundation library
2427
runs-on: macOS-latest
2528
permissions:
2629
contents: write
2730
steps:
2831
- name: Set build variables
2932
run: |
30-
echo "VERSION=${GITHUB_REF_NAME#v}" >> $GITHUB_ENV
33+
echo "VERSION=${GITHUB_REF_NAME#v}" | tee -a $GITHUB_ENV
3134
3235
- name: Set up Python
3336
uses: actions/[email protected]
@@ -41,7 +44,7 @@ jobs:
4144
path: dist
4245

4346
- name: Install packages
44-
run: pip install dist/rubicon_objc-*.whl
47+
run: python -m pip install dist/rubicon_objc-*.whl
4548

4649
- name: Check version number
4750
# Check that the setuptools_scm-generated version number is still the same when
@@ -60,7 +63,7 @@ jobs:
6063

6164
test-publish:
6265
name: Publish test package
63-
needs: [ci, docs, release]
66+
needs: [ ci, docs, release ]
6467
runs-on: ubuntu-latest
6568
permissions:
6669
contents: write

changes/474.misc.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
``hynek/build-and-inspect-python-package`` is now used to create the Python package.

tox.ini

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ allowlist_externals =
3030
make
3131
commands =
3232
make -C tests{/}objc
33-
pytest -vv -- {posargs}
33+
python -m pytest {posargs:-vv --color yes}
3434

3535
[testenv:towncrier{,-check}]
3636
deps =
@@ -68,12 +68,3 @@ commands =
6868
all : python -m sphinx {[docs]sphinx_args} {posargs} -v -a -E -b html {[docs]docs_dir} {[docs]build_dir}{/}html
6969
live-!src : sphinx-autobuild {[docs]sphinx_args} {posargs} -b html {[docs]docs_dir} {[docs]build_dir}{/}live
7070
live-src : sphinx-autobuild {[docs]sphinx_args} {posargs} -a -E --watch {tox_root}{/}src{/}rubicon{/}objc -b html {[docs]docs_dir} {[docs]build_dir}{/}live
71-
72-
[testenv:package]
73-
skip_install = True
74-
deps =
75-
build==1.2.1
76-
twine==5.1.0
77-
commands =
78-
python -m build --outdir dist/ .
79-
python -m twine check dist/*

0 commit comments

Comments
 (0)