From 875f32176a245dd7adc171b63f9d1d195cbe9490 Mon Sep 17 00:00:00 2001 From: Tim Jenness Date: Wed, 1 May 2024 08:54:29 -0700 Subject: [PATCH] Modernize action versions --- .github/workflows/build.yaml | 40 ++++++++++++++++++++++++++++-------- .github/workflows/cmake.yaml | 4 ++-- .github/workflows/lint.yaml | 2 +- 3 files changed, 34 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index f7cce0d8..960ea99b 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -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" @@ -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" @@ -60,7 +82,7 @@ jobs: run: | python -m build --sdist - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: path: dist/* @@ -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 @@ -103,7 +125,7 @@ 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/* @@ -111,7 +133,7 @@ jobs: 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 diff --git a/.github/workflows/cmake.yaml b/.github/workflows/cmake.yaml index 1f589808..78f58dbb 100644 --- a/.github/workflows/cmake.yaml +++ b/.github/workflows/cmake.yaml @@ -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 diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 6c463eed..59bae3f1 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -12,5 +12,5 @@ jobs: ruff: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: chartboost/ruff-action@v1