Skip to content

Commit

Permalink
Modernize action versions
Browse files Browse the repository at this point in the history
  • Loading branch information
timj committed May 1, 2024
1 parent 2554c98 commit 875f321
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 12 deletions.
40 changes: 31 additions & 9 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ jobs:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
# Need to clone everything to determine version from git.
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
Expand All @@ -36,17 +36,39 @@ jobs:
- name: Run tests
run: pytest -r a -v

pypi_check_tag:
runs-on: ubuntu-latest
needs: [build_and_test]
if: startsWith(github.ref, 'refs/tags/')

steps:
- uses: actions/checkout@v4
with:
# Need to clone everything to get all tags.
fetch-depth: 0

- name: Validate tag
run: |
if [[ $(echo ${{ github.ref }} | cut -c -11) = "refs/tags/w" | ]]
then
echo "Weekly tag"
else
echo "UPLOAD=true" >> ${GITHUB_ENV}
echo "Non-weekly tag detected."
fi
pypi_sdist_build:
runs-on: ubuntu-latest
needs: [build_and_test]
if: startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.8
cache: "pip"
Expand All @@ -60,7 +82,7 @@ jobs:
run: |
python -m build --sdist
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
path: dist/*

Expand All @@ -86,13 +108,13 @@ jobs:
# with:
# platforms: arm64

- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
# Need to clone everything to embed the versiona
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.8

Expand All @@ -103,15 +125,15 @@ jobs:
- name: Build and create distribution
run: |
python -m cibuildwheel --output-dir dist
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
path: dist/*

pipy_upload:
needs: [pypi_sdist_build, pypi_wheel_build]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: artifact
path: dist
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/cmake.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ jobs:
cmake:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
# Need to clone everything to determine version from git.
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.8

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ jobs:
ruff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: chartboost/ruff-action@v1

0 comments on commit 875f321

Please sign in to comment.