Skip to content

Commit 64931fd

Browse files
committed
Update CI for docs and releases.
Signed-off-by: Philippe Ombredanne <pombredanne@aboutcode.org>
1 parent 7fe3516 commit 64931fd

3 files changed

Lines changed: 44 additions & 11 deletions

File tree

.github/workflows/docs-ci.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ name: CI Documentation
22

33
on: [push, pull_request]
44

5+
permissions: {}
56
jobs:
67
build:
78
runs-on: ubuntu-24.04
@@ -13,10 +14,12 @@ jobs:
1314

1415
steps:
1516
- name: Checkout code
16-
uses: actions/checkout@v4
17+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
18+
with:
19+
persist-credentials: false
1720

1821
- name: Set up Python ${{ matrix.python-version }}
19-
uses: actions/setup-python@v5
22+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405
2023
with:
2124
python-version: ${{ matrix.python-version }}
2225

.github/workflows/pypi-release.yml

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,49 +18,55 @@ on:
1818
tags:
1919
- "v*.*.*"
2020

21+
permissions: {}
2122
jobs:
2223
build-pypi-distribs:
2324
name: Build and publish library to PyPI
2425
runs-on: ubuntu-24.04
2526

2627
steps:
27-
- uses: actions/checkout@v4
28+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
29+
with:
30+
persist-credentials: false
2831
- name: Set up Python
29-
uses: actions/setup-python@v5
32+
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405
3033
with:
31-
python-version: 3.12
34+
python-version: 3.13
3235

3336
- name: Install pypa/build and twine
3437
run: python -m pip install --user --upgrade build twine pkginfo
3538

3639
- name: Build a binary wheel and a source tarball
3740
run: python -m build --wheel --sdist --outdir dist/
3841

39-
- name: Validate wheel and sdis for Pypi
42+
- name: Validate wheels and sdists for Pypi
4043
run: python -m twine check dist/*
4144

4245
- name: Upload built archives
43-
uses: actions/upload-artifact@v4
46+
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f
4447
with:
4548
name: pypi_archives
4649
path: dist/*
4750

4851

4952
create-gh-release:
53+
# Sets permissions of the GITHUB_TOKEN to allow release upload
54+
permissions:
55+
contents: write
5056
name: Create GH release
5157
needs:
5258
- build-pypi-distribs
5359
runs-on: ubuntu-24.04
5460

5561
steps:
5662
- name: Download built archives
57-
uses: actions/download-artifact@v4
63+
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131
5864
with:
5965
name: pypi_archives
6066
path: dist
6167

6268
- name: Create GH release
63-
uses: softprops/action-gh-release@v2
69+
uses: softprops/action-gh-release@b4309332981a82ec1c5618f44dd2e27cc8bfbfda
6470
with:
6571
draft: true
6672
files: dist/*
@@ -77,11 +83,11 @@ jobs:
7783

7884
steps:
7985
- name: Download built archives
80-
uses: actions/download-artifact@v4
86+
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131
8187
with:
8288
name: pypi_archives
8389
path: dist
8490

8591
- name: Publish to PyPI
8692
if: startsWith(github.ref, 'refs/tags')
87-
uses: pypa/gh-action-pypi-publish@release/v1
93+
uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b

.github/workflows/zizmor.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: GitHub Actions Security Analysis with zizmor 🌈
2+
3+
on:
4+
push:
5+
branches: ["main"]
6+
pull_request:
7+
branches: ["**"]
8+
9+
permissions: {}
10+
11+
jobs:
12+
zizmor:
13+
name: Run zizmor 🌈
14+
runs-on: ubuntu-latest
15+
permissions:
16+
security-events: write # Required for upload-sarif (used by zizmor-action) to upload SARIF files.
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
20+
with:
21+
persist-credentials: false
22+
23+
- name: Run zizmor 🌈
24+
uses: zizmorcore/zizmor-action@b1d7e1fb5de872772f31590499237e7cce841e8e # v0.5.3

0 commit comments

Comments
 (0)