Skip to content

Commit 9af6310

Browse files
committed
Update workflows
- Updates actions to the latest minor versions - Don't rely on the fetch-tags input of the checkout action. It doesn't actually fetch tags. - Don't persist git credentials when we don't need to - Resolve other minor lint issues
1 parent ca4cba5 commit 9af6310

File tree

6 files changed

+85
-62
lines changed

6 files changed

+85
-62
lines changed

.github/workflows/release.yaml

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,16 @@ jobs:
2020
image: danielflook/python-minifier-build:python3.13-2024-09-15
2121
steps:
2222
- name: Checkout
23-
uses: actions/checkout@v4
23+
uses: actions/checkout@v4.2.2
2424
with:
2525
fetch-depth: 1
26-
show-progress: 'false'
26+
show-progress: false
27+
persist-credentials: false
2728

2829
- name: Set version statically
30+
env:
31+
VERSION: ${{ github.event.release.tag_name }}
2932
run: |
30-
VERSION=${{ github.event.release.tag_name }}
3133
sed -i "s/setup_requires=.*/version='$VERSION',/; s/use_scm_version=.*//" setup.py
3234
echo "Version: $VERSION"
3335
@@ -41,14 +43,14 @@ jobs:
4143
echo "wheel=$(find dist -name '*-py3-*.whl' -printf "%f\n")" >> "$GITHUB_OUTPUT"
4244
4345
- name: Upload sdist artifact
44-
uses: actions/upload-artifact@v4
46+
uses: actions/upload-artifact@v4.4.3
4547
with:
4648
name: dist-sdist
4749
path: dist/${{ steps.package.outputs.sdist }}
4850
if-no-files-found: error
4951

5052
- name: Upload Python 3 wheel artifact
51-
uses: actions/upload-artifact@v4
53+
uses: actions/upload-artifact@v4.4.3
5254
with:
5355
name: dist-py3-wheel
5456
path: dist/${{ steps.package.outputs.wheel }}
@@ -64,21 +66,23 @@ jobs:
6466
image: danielflook/python-minifier-build:python2.7-2024-09-15
6567
steps:
6668
- name: Download source distribution artifact
67-
uses: actions/download-artifact@v4
69+
uses: actions/download-artifact@v4.1.8
6870
with:
6971
name: dist-sdist
7072
path: dist/
7173

7274
- name: Build Python 2 wheel
7375
id: package
76+
env:
77+
PYTHON3_SDIST: ${{ needs.package_python3.outputs.sdist }}
7478
run: |
7579
dnf install -y findutils
7680
pip install --upgrade wheel
77-
pip wheel dist/${{ needs.package_python3.outputs.sdist }} -w dist
81+
pip wheel dist/"$PYTHON3_SDIST" -w dist
7882
echo "wheel=$(find dist -name '*-py2-*.whl' -printf "%f\n")" >> "$GITHUB_OUTPUT"
7983
8084
- name: Upload Python 2 wheel artifact
81-
uses: actions/upload-artifact@v4
85+
uses: actions/upload-artifact@v4.4.3
8286
with:
8387
name: dist-py2-wheel
8488
path: dist/${{ steps.package.outputs.wheel }}
@@ -91,29 +95,32 @@ jobs:
9195
container:
9296
image: danielflook/python-minifier-build:python3.13-2024-09-15
9397
steps:
94-
- uses: actions/download-artifact@v4
98+
- uses: actions/download-artifact@v4.1.8
9599
with:
96100
name: dist-sdist
97101
path: dist/
98102

99103
- name: Install package
104+
env:
105+
PYTHON3_SDIST: ${{ needs.package_python3.outputs.sdist }}
100106
run: |
101-
pip3 install dist/${{needs.package_python3.outputs.sdist}}
107+
pip3 install dist/"$PYTHON3_SDIST"
102108
pyminify --version
103109
104110
- name: Checkout
105-
uses: actions/checkout@v4
111+
uses: actions/checkout@v4.2.2
106112
with:
107113
fetch-depth: 1
108-
show-progress: 'false'
114+
show-progress: false
115+
persist-credentials: false
109116

110117
- name: Build documentation
111118
run: |
112119
pip3 install sphinx sphinxcontrib-programoutput sphinx_rtd_theme
113120
sphinx-build docs/source /tmp/build
114121
115122
- name: Upload documentation artifact
116-
uses: actions/upload-pages-artifact@v3
123+
uses: actions/upload-pages-artifact@v3.0.1
117124
with:
118125
path: /tmp/build
119126

@@ -130,14 +137,14 @@ jobs:
130137
url: https://pypi.org/project/python-minifier/${{ github.event.release.tag_name }}
131138
steps:
132139
- name: Download distribution artifacts
133-
uses: actions/download-artifact@v4
140+
uses: actions/download-artifact@v4.1.8
134141
with:
135142
pattern: dist-*
136143
path: dist/
137-
merge-multiple: 'true'
144+
merge-multiple: true
138145

139146
- name: Publish package distributions to PyPI
140-
uses: pypa/gh-action-pypi-publish@v1.10.1
147+
uses: pypa/gh-action-pypi-publish@v1.12.3
141148
with:
142149
print-hash: true
143150
verbose: true
@@ -156,4 +163,4 @@ jobs:
156163
steps:
157164
- name: Deploy to GitHub Pages
158165
id: deployment
159-
uses: actions/deploy-pages@v4
166+
uses: actions/deploy-pages@v4.0.5

.github/workflows/release_test.yaml

Lines changed: 34 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,10 @@ jobs:
1414
image: danielflook/python-minifier-build:python3.13-2024-09-15
1515
steps:
1616
- name: Checkout
17-
uses: actions/checkout@v4
17+
uses: actions/checkout@v4.2.2
1818
with:
1919
fetch-depth: 1
20-
fetch-tags: 'true'
21-
show-progress: 'false'
20+
show-progress: false
2221

2322
- name: Set version statically
2423
run: |
@@ -37,14 +36,14 @@ jobs:
3736
echo "wheel=$(find dist -name '*-py3-*.whl' -printf "%f\n")" >> "$GITHUB_OUTPUT"
3837
3938
- name: Upload sdist artifact
40-
uses: actions/upload-artifact@v4
39+
uses: actions/upload-artifact@v4.4.3
4140
with:
4241
name: dist-sdist
4342
path: dist/${{ steps.package.outputs.sdist }}
4443
if-no-files-found: error
4544

4645
- name: Upload Python 3 wheel artifact
47-
uses: actions/upload-artifact@v4
46+
uses: actions/upload-artifact@v4.4.3
4847
with:
4948
name: dist-py3-wheel
5049
path: dist/${{ steps.package.outputs.wheel }}
@@ -60,21 +59,23 @@ jobs:
6059
image: danielflook/python-minifier-build:python2.7-2024-09-15
6160
steps:
6261
- name: Download source distribution artifact
63-
uses: actions/download-artifact@v4
62+
uses: actions/download-artifact@v4.1.8
6463
with:
6564
name: dist-sdist
6665
path: dist/
6766

6867
- name: Build Python 2 wheel
6968
id: package
69+
env:
70+
PYTHON3_SDIST: ${{ needs.package_python3.outputs.sdist }}
7071
run: |
7172
dnf install -y findutils
7273
pip install --upgrade wheel
73-
pip wheel dist/${{ needs.package_python3.outputs.sdist }} -w dist
74+
pip wheel "dist/$PYTHON3_SDIST" -w dist
7475
echo "wheel=$(find dist -name '*-py2-*.whl' -printf "%f\n")" >> "$GITHUB_OUTPUT"
7576
7677
- name: Upload Python 2 wheel artifact
77-
uses: actions/upload-artifact@v4
78+
uses: actions/upload-artifact@v4.4.3
7879
with:
7980
name: dist-py2-wheel
8081
path: dist/${{ steps.package.outputs.wheel }}
@@ -87,22 +88,25 @@ jobs:
8788
container:
8889
image: danielflook/python-minifier-build:python3.13-2024-09-15
8990
steps:
90-
- uses: actions/download-artifact@v4
91+
- uses: actions/download-artifact@v4.1.8
9192
with:
9293
name: dist-sdist
9394
path: dist/
9495

9596
- name: Install package
97+
env:
98+
PYTHON3_SDIST: ${{ needs.package_python3.outputs.sdist }}
9699
run: |
97-
pip3 install dist/${{needs.package_python3.outputs.sdist}}
100+
pip3 install "dist/$PYTHON3_SDIST"
98101
pyminify --version
99102
100103
- name: Checkout
101-
uses: actions/checkout@v4
104+
uses: actions/checkout@v4.2.2
102105
with:
103106
fetch-depth: 1
104-
fetch-tags: 'true'
105-
show-progress: 'false'
107+
fetch-tags: true
108+
show-progress: false
109+
persist-credentials: false
106110

107111
- name: Build documentation
108112
run: |
@@ -120,18 +124,19 @@ jobs:
120124
package_type: [sdist, wheel]
121125
steps:
122126
- name: Checkout
123-
uses: actions/checkout@v4
127+
uses: actions/checkout@v4.2.2
124128
with:
125129
fetch-depth: 1
126-
fetch-tags: 'true'
127-
show-progress: 'false'
130+
fetch-tags: true
131+
show-progress: false
132+
persist-credentials: false
128133

129134
- name: Download distribution artifacts
130-
uses: actions/download-artifact@v4
135+
uses: actions/download-artifact@v4.1.8
131136
with:
132137
pattern: dist-*
133138
path: dist/
134-
merge-multiple: 'true'
139+
merge-multiple: true
135140

136141
- name: Test
137142
uses: ./.github/actions/run-in-container
@@ -165,26 +170,30 @@ jobs:
165170
image: danielflook/python-minifier-build:python3.13-2024-09-15
166171
steps:
167172
- name: Download distribution artifacts
168-
uses: actions/download-artifact@v4
173+
uses: actions/download-artifact@v4.1.8
169174
with:
170175
pattern: dist-*
171176
path: dist/
172-
merge-multiple: 'true'
177+
merge-multiple: true
173178

174179
- name: Install package
180+
env:
181+
PYTHON3_SDIST: ${{ needs.package_python3.outputs.sdist }}
182+
PYTHON3_WHEEL: ${{ needs.package_python3.outputs.wheel }}
175183
run: |
176184
if [[ "${{ matrix.package_type }}" == "sdist" ]]; then
177-
pip3.13 install dist/${{needs.package_python3.outputs.sdist}}
185+
pip3.13 install "dist/$PYTHON3_SDIST"
178186
else
179-
pip3.13 install dist/${{needs.package_python3.outputs.wheel}}
187+
pip3.13 install "dist/$PYTHON3_WHEEL"
180188
fi
181189
182190
- name: Checkout
183-
uses: actions/checkout@v4
191+
uses: actions/checkout@v4.2.2
184192
with:
185193
fetch-depth: 1
186-
fetch-tags: 'true'
187-
show-progress: 'false'
194+
fetch-tags: true
195+
show-progress: false
196+
persist-credentials: false
188197

189198
- name: Test typing
190199
run: |

.github/workflows/test.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ jobs:
1313
python: ["python2.7", "python3.3", "python3.4", "python3.5", "python3.6", "python3.7", "python3.8", "python3.9", "python3.10", "python3.11", "python3.12", "python3.13", "pypy", "pypy3"]
1414
steps:
1515
- name: Checkout
16-
uses: actions/checkout@v4
16+
uses: actions/checkout@v4.2.2
1717
with:
1818
fetch-depth: 1
19-
fetch-tags: 'true'
20-
show-progress: 'false'
19+
show-progress: false
20+
persist-credentials: false
2121

2222
- name: Set version statically
2323
run: |

.github/workflows/test_corpus.yaml

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -48,21 +48,23 @@ jobs:
4848
run: rm -rf "$GITHUB_WORKSPACE/*"
4949

5050
- name: Checkout workflow ref
51-
uses: actions/checkout@v4.2.0
51+
uses: actions/checkout@v4.2.2
5252
with:
5353
fetch-depth: 1
54-
show-progress: 'false'
54+
show-progress: false
5555
path: workflow
56+
persist-credentials: false
5657

5758
- name: Checkout ref
5859
id: checkout-ref
59-
uses: actions/checkout@v4.2.0
60+
uses: actions/checkout@v4.2.2
6061
with:
6162
fetch-depth: 1
62-
fetch-tags: 'true'
63-
show-progress: 'false'
63+
fetch-tags: true
64+
show-progress: false
6465
ref: ${{ matrix.ref }}
6566
path: python-minifier
67+
persist-credentials: false
6668

6769
- name: Run tests
6870
uses: dflook/run-in-container@main
@@ -106,31 +108,34 @@ jobs:
106108
run: rm -rf "$GITHUB_WORKSPACE/*"
107109

108110
- name: Checkout workflow ref
109-
uses: actions/checkout@v4.2.0
111+
uses: actions/checkout@v4.2.2
110112
with:
111113
path: workflow
112114
fetch-depth: 1
113-
show-progress: 'false'
115+
show-progress: false
116+
persist-credentials: false
114117

115118
- name: Checkout ref
116119
id: ref
117-
uses: actions/checkout@v4.2.0
120+
uses: actions/checkout@v4.2.2
118121
with:
119122
ref: ${{ inputs.ref }}
120123
path: python-minifier
121124
fetch-depth: 1
122-
fetch-tags: 'true'
123-
show-progress: 'false'
125+
fetch-tags: true
126+
show-progress: false
127+
persist-credentials: false
124128

125129
- name: Checkout base ref
126130
id: base-ref
127-
uses: actions/checkout@v4.2.0
131+
uses: actions/checkout@v4.2.2
128132
with:
129133
ref: ${{ inputs.base-ref }}
130134
path: python-minifier-base
131135
fetch-depth: 1
132-
fetch-tags: 'true'
133-
show-progress: 'false'
136+
fetch-tags: true
137+
show-progress: false
138+
persist-credentials: false
134139

135140
- name: Generate Report
136141
uses: dflook/run-in-container@main

.github/workflows/verify_release.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ jobs:
1818
image: danielflook/python-minifier-build:python${{ matrix.python }}-2024-09-15
1919
steps:
2020
- name: Test
21+
env:
22+
VERSION: ${{ inputs.version }}
2123
run: |
22-
pip${{ matrix.python }} install python-minifier==${{ inputs.version }}
24+
pip${{ matrix.python }} install "python-minifier==$VERSION"
2325
pyminify --version

.github/workflows/xtest.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ jobs:
1616
run: rm -rf "$GITHUB_WORKSPACE/*"
1717

1818
- name: Checkout
19-
uses: actions/checkout@v4
19+
uses: actions/checkout@v4.2.2
2020
with:
2121
fetch-depth: 1
22-
fetch-tags: 'true'
23-
show-progress: 'false'
22+
show-progress: false
23+
persist-credentials: false
2424

2525
- name: Set version statically
2626
run: |

0 commit comments

Comments
 (0)