Skip to content

Commit

Permalink
Fix skipping packages in test-n-publish
Browse files Browse the repository at this point in the history
  • Loading branch information
soininen committed Mar 27, 2024
1 parent a573dd1 commit 4e7e08d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish-wheel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ on:

jobs:
publish-whl:
if: ${{ inputs.ver }} != 'skip'
if: ${{ inputs.ver != 'skip' }}
runs-on: ubuntu-latest
permissions:
id-token: write
Expand Down
18 changes: 13 additions & 5 deletions .github/workflows/test-n-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,27 @@ jobs:
strategy:
matrix:
pkg: ['Spine-Database-API', 'spine-engine', 'spine-items', 'Spine-Toolbox']

runs-on: ubuntu-latest
steps:
- name: Checkout ${{ matrix.pkg }}
- name: Checkout ${{ matrix.pkg }} for publishing
if: ${{ inputs[matrix.pkg] != 'skip' }}
uses: actions/checkout@v3
with:
repository: 'spine-tools/${{ matrix.pkg }}'
path: ${{ matrix.pkg }}
ref: ${{ inputs[matrix.pkg] }}
- name: Checkout ${{ matrix.pkg }} for testing only
if: ${{ inputs[matrix.pkg] == 'skip' }}
uses: actions/checkout@v3
with:
repository: 'spine-tools/${{ matrix.pkg }}'
path: ${{ matrix.pkg }}
ref: ${{ inputs[matrix.pkg] }}
- name: Ensure Git checkout is not dirty
if: ${{ inputs[matrix.pkg] != 'skip' }}
run: cd ${{ matrix.pkg }} && git describe --tags --dirty | grep -vE '[-]dirty$'
- name: Ensure Git checkout does not have additional commits
if: ${{ inputs[matrix.pkg] != 'skip' }}
run: cd ${{ matrix.pkg }} && git describe --tags | grep -vE '[-]g[a-z0-9]{8}$'
- name: Set up Python
uses: actions/setup-python@v4
Expand All @@ -47,11 +56,11 @@ jobs:
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
Expand Down Expand Up @@ -135,7 +144,6 @@ jobs:
strategy:
matrix:
pkg: ['Spine-Database-API', 'spine-engine', 'spine-items', 'Spine-Toolbox']

uses: ./.github/workflows/publish-wheel.yml
with:
pkg: ${{ matrix.pkg }}
Expand Down

0 comments on commit 4e7e08d

Please sign in to comment.