Skip to content

Commit a47da57

Browse files
committed
review CI workflows
per cpp-linter/.github#41 and cpp-linter/.github#40
1 parent bafc097 commit a47da57

File tree

5 files changed

+67
-31
lines changed

5 files changed

+67
-31
lines changed
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
path_to_doc: docs/_build/html
1010

1111
steps:
12-
- uses: actions/checkout@v5
12+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 #v5.0.0
1313

1414
- name: Install uv
1515
uses: astral-sh/setup-uv@557e51de59eb14aaaba2ed9621916900a91d50c6 # v6.6.1
@@ -21,15 +21,15 @@ jobs:
2121
run: uvx nox -s docs
2222

2323
- name: Upload docs build as artifact
24-
uses: actions/upload-artifact@v4
24+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
2525
with:
2626
name: ${{ github.event.repository.name }}_docs
2727
path: ${{ github.workspace }}/${{ env.path_to_doc }}
2828

2929
- name: Upload to github pages
3030
# only publish doc changes from main branch
3131
if: github.ref == 'refs/heads/main' && github.repository == 'cpp-linter/cpp-linter'
32-
uses: peaceiris/actions-gh-pages@v4
32+
uses: peaceiris/actions-gh-pages@4f9cc6602d3f66b9c108549d475ec49e8ef4d45e # v4.0.0
3333
with:
3434
github_token: ${{ secrets.GITHUB_TOKEN }}
3535
publish_dir: ./${{ env.path_to_doc }}

.github/workflows/publish-pypi.yml

Lines changed: 0 additions & 20 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# This workflow will upload a Python Package using Twine when a release is created
2+
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
3+
4+
# This workflow uses actions that are not certified by GitHub.
5+
# They are provided by a third-party and are governed by
6+
# separate terms of service, privacy policy, and support
7+
# documentation.
8+
9+
name: Upload Python Package
10+
11+
on:
12+
push:
13+
branches: [main]
14+
tags: ['v*']
15+
workflow_dispatch:
16+
17+
jobs:
18+
build:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 #v5.0.0
22+
# use fetch --all for setuptools_scm to work
23+
with:
24+
fetch-depth: 0
25+
- name: Set up Python
26+
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 #v5.6.0
27+
with:
28+
python-version: '3.x'
29+
- name: Build distributions
30+
run: pipx run build -o dist
31+
- name: Upload builds as artifacts
32+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
33+
with:
34+
path: dist
35+
name: wheels
36+
37+
deploy:
38+
runs-on: ubuntu-latest
39+
needs: [build]
40+
steps:
41+
- name: Download distributions
42+
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
43+
with:
44+
name: wheels
45+
path: dist
46+
- name: Set up Python
47+
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
48+
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 #v5.6.0
49+
with:
50+
python-version: '3.x'
51+
- name: Check distributions
52+
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
53+
run: pipx run twine check dist/*
54+
- name: Deploy to PyPI
55+
if: startsWith(github.ref, 'refs/tags/')
56+
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
steps:
3737
- uses: actions/checkout@v5
3838

39-
- uses: actions/setup-python@v5
39+
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 #v5.6.0
4040
with:
4141
python-version: 3.x
4242

@@ -95,7 +95,7 @@ jobs:
9595
run: |-
9696
from os import environ
9797
with open(environ["GITHUB_OUTPUT"], mode="a") as gh_out:
98-
if ${{ matrix.version }} == 20:
98+
if ${{ matrix.version }} == 21:
9999
gh_out.write("args=\n")
100100
else:
101101
gh_out.write("args=-m \"not no_clang\"\n")
@@ -107,7 +107,7 @@ jobs:
107107
run: uvx nox -s test-all -- ${{ steps.clang-dep.outputs.args }}
108108

109109
- name: Upload coverage data
110-
uses: actions/upload-artifact@v4
110+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
111111
with:
112112
name: coverage-data-${{ runner.os }}-${{ matrix.version }}
113113
path: .coverage*
@@ -118,16 +118,16 @@ jobs:
118118
runs-on: ubuntu-latest
119119

120120
steps:
121-
- uses: actions/checkout@v5
121+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 #v5.0.0
122122

123123
- name: Download all artifacts
124-
uses: actions/download-artifact@v5
124+
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
125125
with:
126126
pattern: coverage-data-*
127127
merge-multiple: true
128128

129129
- name: Setup python
130-
uses: actions/setup-python@v5
130+
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 #v5.6.0
131131
with:
132132
python-version: '3.x'
133133

@@ -141,12 +141,12 @@ jobs:
141141
run: uvx nox -s coverage
142142

143143
- name: Upload comprehensive coverage HTML report
144-
uses: actions/upload-artifact@v4
144+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
145145
with:
146146
name: coverage-report
147147
path: htmlcov/
148148

149-
- uses: codecov/codecov-action@v5
149+
- uses: codecov/codecov-action@fdcc8476540edceab3de004e990f80d881c6cc00 # v5.5.0
150150
env:
151151
CODECOV_TOKEN: ${{secrets.CODECOV_TOKEN}}
152152
with:

0 commit comments

Comments
 (0)