Skip to content

Commit

Permalink
workflows: upgrade actions, and cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
suvayu committed Aug 25, 2024
1 parent ae8f2d8 commit c26062a
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 17 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/publish-wheel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ on:

jobs:
publish-whl:
if: ${{ inputs.ver }} != 'skip'
if: inputs.ver != 'skip'
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- name: Make dist directory
run: mkdir -p dist
- name: Download all wheels
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
path: dist
- name: Publish to PyPI using trusted publishing
Expand Down
17 changes: 9 additions & 8 deletions .github/workflows/test-n-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,12 @@ jobs:
strategy:
matrix:
pkg: ['Spine-Database-API', 'spine-engine', 'spine-items', 'Spine-Toolbox']
python: ["3.8"]

runs-on: ubuntu-latest
steps:
- name: Checkout ${{ matrix.pkg }}
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: 'spine-tools/${{ matrix.pkg }}'
path: ${{ matrix.pkg }}
Expand All @@ -39,26 +40,26 @@ jobs:
- name: Ensure Git checkout does not have additional commits
run: cd ${{ matrix.pkg }} && git describe --tags | grep -vE '[-]g[a-z0-9]{8}$'
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.8'
python-version: ${{ matrix.python }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install build
- name: Build
if: ${{ inputs[matrix.pkg] != 'skip' }}
if: inputs[matrix.pkg] != 'skip'
run: |
python -m build ${{ matrix.pkg }}
- name: Download wheels for packages excluded from build
if: ${{ inputs[matrix.pkg] == 'skip' }}
if: inputs[matrix.pkg] == 'skip'
run: |
mkdir -p ${{ matrix.pkg }}/dist/
sed -nEe 's/name[ ]*=[ ]*"?([a-z0-9_-]+)"?/\1/p' ${{ matrix.pkg }}/pyproject.toml > pkgname
python -m pip download --no-deps --python-version 3.8 \
python -m pip download --no-deps --python-version ${{ matrix.python }} \
--dest ${{ matrix.pkg }}/dist/ $(cat pkgname)
- name: Save ${{ matrix.pkg }} wheel
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.pkg }}
path: ${{ matrix.pkg }}/dist/*
Expand All @@ -70,7 +71,7 @@ jobs:
matrix:
pkg: ['Spine-Database-API', 'spine-engine', 'spine-items', 'Spine-Toolbox']
os: [ubuntu-latest, windows-latest]
python: ["3.8", "3.9", "3.10", "3.11"]
python: ["3.8", "3.9", "3.10", "3.11", "3.12"]
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/unittests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ jobs:

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
allow-prereleases: true
python-version: ${{ matrix.python-version }}
Expand All @@ -49,7 +49,7 @@ jobs:

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Ruff with Python target version ${{ matrix.pyver }}
uses: chartboost/ruff-action@v1
with:
Expand Down Expand Up @@ -78,9 +78,9 @@ jobs:
- name: Disable autocrlf so that we can test preserve LE on Windows
if: matrix.os == 'windows-latest'
run: git config --global core.autocrlf ${{ matrix.autocrlf }}
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
allow-prereleases: true
python-version: ${{ matrix.python-version }}
Expand All @@ -104,9 +104,9 @@ jobs:
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
allow-prereleases: true
python-version: ${{ matrix.python-version }}
Expand Down

0 comments on commit c26062a

Please sign in to comment.