Skip to content

Commit

Permalink
Update workflows
Browse files Browse the repository at this point in the history
- 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
  • Loading branch information
dflook committed Dec 9, 2024
1 parent ca4cba5 commit 9af6310
Show file tree
Hide file tree
Showing 6 changed files with 85 additions and 62 deletions.
41 changes: 24 additions & 17 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,16 @@ jobs:
image: danielflook/python-minifier-build:python3.13-2024-09-15
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v4.2.2
with:
fetch-depth: 1
show-progress: 'false'
show-progress: false
persist-credentials: false

- name: Set version statically
env:
VERSION: ${{ github.event.release.tag_name }}
run: |
VERSION=${{ github.event.release.tag_name }}
sed -i "s/setup_requires=.*/version='$VERSION',/; s/use_scm_version=.*//" setup.py
echo "Version: $VERSION"
Expand All @@ -41,14 +43,14 @@ jobs:
echo "wheel=$(find dist -name '*-py3-*.whl' -printf "%f\n")" >> "$GITHUB_OUTPUT"
- name: Upload sdist artifact
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v4.4.3
with:
name: dist-sdist
path: dist/${{ steps.package.outputs.sdist }}
if-no-files-found: error

- name: Upload Python 3 wheel artifact
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v4.4.3
with:
name: dist-py3-wheel
path: dist/${{ steps.package.outputs.wheel }}
Expand All @@ -64,21 +66,23 @@ jobs:
image: danielflook/python-minifier-build:python2.7-2024-09-15
steps:
- name: Download source distribution artifact
uses: actions/download-artifact@v4
uses: actions/download-artifact@v4.1.8
with:
name: dist-sdist
path: dist/

- name: Build Python 2 wheel
id: package
env:
PYTHON3_SDIST: ${{ needs.package_python3.outputs.sdist }}
run: |
dnf install -y findutils
pip install --upgrade wheel
pip wheel dist/${{ needs.package_python3.outputs.sdist }} -w dist
pip wheel dist/"$PYTHON3_SDIST" -w dist
echo "wheel=$(find dist -name '*-py2-*.whl' -printf "%f\n")" >> "$GITHUB_OUTPUT"
- name: Upload Python 2 wheel artifact
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v4.4.3
with:
name: dist-py2-wheel
path: dist/${{ steps.package.outputs.wheel }}
Expand All @@ -91,29 +95,32 @@ jobs:
container:
image: danielflook/python-minifier-build:python3.13-2024-09-15
steps:
- uses: actions/download-artifact@v4
- uses: actions/download-artifact@v4.1.8
with:
name: dist-sdist
path: dist/

- name: Install package
env:
PYTHON3_SDIST: ${{ needs.package_python3.outputs.sdist }}
run: |
pip3 install dist/${{needs.package_python3.outputs.sdist}}
pip3 install dist/"$PYTHON3_SDIST"
pyminify --version
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v4.2.2
with:
fetch-depth: 1
show-progress: 'false'
show-progress: false
persist-credentials: false

- name: Build documentation
run: |
pip3 install sphinx sphinxcontrib-programoutput sphinx_rtd_theme
sphinx-build docs/source /tmp/build
- name: Upload documentation artifact
uses: actions/upload-pages-artifact@v3
uses: actions/upload-pages-artifact@v3.0.1
with:
path: /tmp/build

Expand All @@ -130,14 +137,14 @@ jobs:
url: https://pypi.org/project/python-minifier/${{ github.event.release.tag_name }}
steps:
- name: Download distribution artifacts
uses: actions/download-artifact@v4
uses: actions/download-artifact@v4.1.8
with:
pattern: dist-*
path: dist/
merge-multiple: 'true'
merge-multiple: true

- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@v1.10.1
uses: pypa/gh-action-pypi-publish@v1.12.3
with:
print-hash: true
verbose: true
Expand All @@ -156,4 +163,4 @@ jobs:
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
uses: actions/deploy-pages@v4.0.5
59 changes: 34 additions & 25 deletions .github/workflows/release_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,10 @@ jobs:
image: danielflook/python-minifier-build:python3.13-2024-09-15
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v4.2.2
with:
fetch-depth: 1
fetch-tags: 'true'
show-progress: 'false'
show-progress: false

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

- name: Upload Python 3 wheel artifact
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v4.4.3
with:
name: dist-py3-wheel
path: dist/${{ steps.package.outputs.wheel }}
Expand All @@ -60,21 +59,23 @@ jobs:
image: danielflook/python-minifier-build:python2.7-2024-09-15
steps:
- name: Download source distribution artifact
uses: actions/download-artifact@v4
uses: actions/download-artifact@v4.1.8
with:
name: dist-sdist
path: dist/

- name: Build Python 2 wheel
id: package
env:
PYTHON3_SDIST: ${{ needs.package_python3.outputs.sdist }}
run: |
dnf install -y findutils
pip install --upgrade wheel
pip wheel dist/${{ needs.package_python3.outputs.sdist }} -w dist
pip wheel "dist/$PYTHON3_SDIST" -w dist
echo "wheel=$(find dist -name '*-py2-*.whl' -printf "%f\n")" >> "$GITHUB_OUTPUT"
- name: Upload Python 2 wheel artifact
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v4.4.3
with:
name: dist-py2-wheel
path: dist/${{ steps.package.outputs.wheel }}
Expand All @@ -87,22 +88,25 @@ jobs:
container:
image: danielflook/python-minifier-build:python3.13-2024-09-15
steps:
- uses: actions/download-artifact@v4
- uses: actions/download-artifact@v4.1.8
with:
name: dist-sdist
path: dist/

- name: Install package
env:
PYTHON3_SDIST: ${{ needs.package_python3.outputs.sdist }}
run: |
pip3 install dist/${{needs.package_python3.outputs.sdist}}
pip3 install "dist/$PYTHON3_SDIST"
pyminify --version
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v4.2.2
with:
fetch-depth: 1
fetch-tags: 'true'
show-progress: 'false'
fetch-tags: true
show-progress: false
persist-credentials: false

- name: Build documentation
run: |
Expand All @@ -120,18 +124,19 @@ jobs:
package_type: [sdist, wheel]
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v4.2.2
with:
fetch-depth: 1
fetch-tags: 'true'
show-progress: 'false'
fetch-tags: true
show-progress: false
persist-credentials: false

- name: Download distribution artifacts
uses: actions/download-artifact@v4
uses: actions/download-artifact@v4.1.8
with:
pattern: dist-*
path: dist/
merge-multiple: 'true'
merge-multiple: true

- name: Test
uses: ./.github/actions/run-in-container
Expand Down Expand Up @@ -165,26 +170,30 @@ jobs:
image: danielflook/python-minifier-build:python3.13-2024-09-15
steps:
- name: Download distribution artifacts
uses: actions/download-artifact@v4
uses: actions/download-artifact@v4.1.8
with:
pattern: dist-*
path: dist/
merge-multiple: 'true'
merge-multiple: true

- name: Install package
env:
PYTHON3_SDIST: ${{ needs.package_python3.outputs.sdist }}
PYTHON3_WHEEL: ${{ needs.package_python3.outputs.wheel }}
run: |
if [[ "${{ matrix.package_type }}" == "sdist" ]]; then
pip3.13 install dist/${{needs.package_python3.outputs.sdist}}
pip3.13 install "dist/$PYTHON3_SDIST"
else
pip3.13 install dist/${{needs.package_python3.outputs.wheel}}
pip3.13 install "dist/$PYTHON3_WHEEL"
fi
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v4.2.2
with:
fetch-depth: 1
fetch-tags: 'true'
show-progress: 'false'
fetch-tags: true
show-progress: false
persist-credentials: false

- name: Test typing
run: |
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ jobs:
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"]
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v4.2.2
with:
fetch-depth: 1
fetch-tags: 'true'
show-progress: 'false'
show-progress: false
persist-credentials: false

- name: Set version statically
run: |
Expand Down
31 changes: 18 additions & 13 deletions .github/workflows/test_corpus.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,21 +48,23 @@ jobs:
run: rm -rf "$GITHUB_WORKSPACE/*"

- name: Checkout workflow ref
uses: actions/[email protected].0
uses: actions/[email protected].2
with:
fetch-depth: 1
show-progress: 'false'
show-progress: false
path: workflow
persist-credentials: false

- name: Checkout ref
id: checkout-ref
uses: actions/[email protected].0
uses: actions/[email protected].2
with:
fetch-depth: 1
fetch-tags: 'true'
show-progress: 'false'
fetch-tags: true
show-progress: false
ref: ${{ matrix.ref }}
path: python-minifier
persist-credentials: false

- name: Run tests
uses: dflook/run-in-container@main
Expand Down Expand Up @@ -106,31 +108,34 @@ jobs:
run: rm -rf "$GITHUB_WORKSPACE/*"

- name: Checkout workflow ref
uses: actions/[email protected].0
uses: actions/[email protected].2
with:
path: workflow
fetch-depth: 1
show-progress: 'false'
show-progress: false
persist-credentials: false

- name: Checkout ref
id: ref
uses: actions/[email protected].0
uses: actions/[email protected].2
with:
ref: ${{ inputs.ref }}
path: python-minifier
fetch-depth: 1
fetch-tags: 'true'
show-progress: 'false'
fetch-tags: true
show-progress: false
persist-credentials: false

- name: Checkout base ref
id: base-ref
uses: actions/[email protected].0
uses: actions/[email protected].2
with:
ref: ${{ inputs.base-ref }}
path: python-minifier-base
fetch-depth: 1
fetch-tags: 'true'
show-progress: 'false'
fetch-tags: true
show-progress: false
persist-credentials: false

- name: Generate Report
uses: dflook/run-in-container@main
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/verify_release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ jobs:
image: danielflook/python-minifier-build:python${{ matrix.python }}-2024-09-15
steps:
- name: Test
env:
VERSION: ${{ inputs.version }}
run: |
pip${{ matrix.python }} install python-minifier==${{ inputs.version }}
pip${{ matrix.python }} install "python-minifier==$VERSION"
pyminify --version
6 changes: 3 additions & 3 deletions .github/workflows/xtest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ jobs:
run: rm -rf "$GITHUB_WORKSPACE/*"

- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v4.2.2
with:
fetch-depth: 1
fetch-tags: 'true'
show-progress: 'false'
show-progress: false
persist-credentials: false

- name: Set version statically
run: |
Expand Down

0 comments on commit 9af6310

Please sign in to comment.