Skip to content

Commit b4ee404

Browse files
authored
ci: pin actions (#11)
* ci: pin actions * fix: remove windows arm
1 parent 590250c commit b4ee404

3 files changed

Lines changed: 55 additions & 32 deletions

File tree

.github/workflows/docs.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,22 +24,25 @@ jobs:
2424
permissions:
2525
pages: write
2626
id-token: write
27+
contents: read
2728
environment:
2829
name: github-pages
2930
url: ${{ steps.deployment.outputs.page_url }}
3031
runs-on: ubuntu-latest
3132
steps:
3233
- name: Checkout
33-
uses: actions/checkout@v4
34+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
35+
with:
36+
persist-credentials: false
3437

35-
- uses: astral-sh/setup-uv@v6
38+
- uses: astral-sh/setup-uv@6b9c6063abd6010835644d4c2e1bef4cf5cd0fca # v6.0.1
3639
- run: uv run mkdocs build --strict
3740

3841
- name: Upload artifact
39-
uses: actions/upload-pages-artifact@v3
42+
uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3.0.1
4043
with:
4144
path: './site'
4245

4346
- name: Deploy to GitHub Pages
4447
id: deployment
45-
uses: actions/deploy-pages@v4
48+
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5

.github/workflows/release.yml

Lines changed: 41 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -3,52 +3,64 @@ name: Build
33
on:
44
push:
55
tags:
6-
- 'v*.*.*'
6+
- 'v[0-9].[0-9]+.[0-9]+'
77
workflow_dispatch:
88
pull_request:
99

1010
concurrency:
11-
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
11+
group: ${{ github.workflow }}-${{ github.ref }}
1212
cancel-in-progress: true
1313

1414
jobs:
1515
build_wheels:
1616
name: Build wheels on ${{ matrix.os }}
1717
runs-on: ${{ matrix.os }}
18+
permissions:
19+
contents: read
1820
strategy:
1921
matrix:
2022
# macos-13 is an intel runner, macos-14 is apple silicon
2123
os: [ubuntu-latest, ubuntu-24.04-arm, windows-latest, macos-13, macos-14]
2224

2325
steps:
24-
- uses: actions/checkout@v4
26+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
27+
with:
28+
persist-credentials: false
2529

2630
- name: Install uv
27-
uses: astral-sh/setup-uv@v6
31+
uses: astral-sh/setup-uv@6b9c6063abd6010835644d4c2e1bef4cf5cd0fca # v6.0.1
32+
with:
33+
enable-cache: false
2834

2935
- name: Build wheels
30-
uses: pypa/cibuildwheel@v2.23.3
36+
uses: pypa/cibuildwheel@faf86a6ed7efa889faf6996aa23820831055001a # v2.23.3
3137

32-
- uses: actions/upload-artifact@v4
38+
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
3339
with:
3440
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
3541
path: ./wheelhouse/*.whl
3642

3743
build_sdist:
44+
if: ${{ startsWith(github.ref, 'refs/tags/') }}
3845
name: Build sdist
3946
runs-on: ubuntu-latest
47+
permissions:
48+
contents: read
4049
steps:
41-
- uses: actions/checkout@v4
50+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
51+
with:
52+
persist-credentials: false
4253

4354
- name: Build sdist
4455
run: pipx run build --sdist
4556

46-
- uses: actions/upload-artifact@v4
57+
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
4758
with:
4859
name: cibw-sdist
4960
path: dist/*.tar.gz
5061

5162
publish:
63+
if: ${{ startsWith(github.ref, 'refs/tags/') }}
5264
needs: [build_wheels, build_sdist]
5365
environment: pypi
5466
permissions:
@@ -57,33 +69,37 @@ jobs:
5769
runs-on: ubuntu-latest
5870
steps:
5971
- name: Checkout code
60-
uses: actions/checkout@v4
72+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
6173
with:
6274
fetch-depth: 0 # Required for changelog
75+
persist-credentials: false
6376

64-
- uses: actions/download-artifact@v4
77+
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
6578
with:
6679
pattern: cibw-*
6780
path: dist
6881
merge-multiple: true
6982

7083
- name: Upload to PyPI
71-
if: ${{ startsWith(github.ref, 'refs/tags/') }}
72-
uses: pypa/gh-action-pypi-publish@release/v1
84+
uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # v1.12.4
7385
with:
7486
skip-existing: true
7587

76-
- name: Generate changelog with git-cliff
77-
uses: tj-actions/git-cliff@v1
78-
with:
79-
args: --latest --strip all
80-
output: "CHANGELOG.md"
88+
- name: Generate a changelog
89+
shell: bash
90+
run: >-
91+
pipx run git-cliff --config .github/cliff-template.toml
92+
--github-repo "${GH_REPO}"
93+
--github-token "${GH_TOKEN}"
94+
--latest --output "CHANGELOG.md"
95+
env:
96+
GH_TOKEN: ${{ github.token }}
97+
GH_REPO: ${{ github.repository }}
8198

82-
- name: Create Github release
83-
if: ${{ startsWith(github.ref, 'refs/tags/') }}
84-
uses: ncipollo/release-action@v1
85-
with:
86-
token: ${{ secrets.GITHUB_TOKEN }}
87-
bodyFile: "CHANGELOG.md"
88-
draft: false
89-
prerelease: false
99+
100+
- name: Create Release
101+
shell: bash
102+
run: gh release create "${GH_REF_NAME}" -F "CHANGELOG.md" --fail-on-no-commits
103+
env:
104+
GH_TOKEN: ${{ github.token }}
105+
GH_REF_NAME: ${{ github.ref_name }}

.github/workflows/tests.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,14 @@ jobs:
3535
matrix:
3636
os: [ubuntu-latest, macos-latest, windows-latest]
3737
runs-on: ${{ matrix.os }}
38+
permissions:
39+
contents: read
3840
steps:
39-
- uses: actions/checkout@v4
41+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
42+
with:
43+
persist-credentials: false
4044

41-
- uses: actions/setup-python@v5
45+
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
4246
with:
4347
python-version: |
4448
3.9
@@ -50,5 +54,5 @@ jobs:
5054
pypy3.10
5155
pypy3.11
5256
53-
- uses: astral-sh/setup-uv@v6
57+
- uses: astral-sh/setup-uv@6b9c6063abd6010835644d4c2e1bef4cf5cd0fca # v6.0.1
5458
- run: uv run nox

0 commit comments

Comments
 (0)