Skip to content

Publish specified tags of Spine packages #70

Publish specified tags of Spine packages

Publish specified tags of Spine packages #70

name: Publish specified tags of Spine packages
on:
workflow_dispatch:
inputs:
Spine-Toolbox:
description: Git tag to use for 'Spine-Toolbox'
type: string
default: 'skip'
spine-items:
description: Git tag to use for 'spine-items'
type: string
default: 'skip'
spine-engine:
description: Git tag to use for 'spine-engine'
type: string
default: 'skip'
Spine-Database-API:
description: Git tag to use for 'Spine-Database-API'
type: string
default: 'skip'
jobs:
build:
strategy:
matrix:
pkg: ['Spine-Database-API', 'spine-engine', 'spine-items', 'Spine-Toolbox']
python: ["3.12"]
runs-on: ubuntu-latest
steps:
- name: Checkout spine-conductor (for actions)
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install build
- name: Build ${{ matrix.pkg }}==${{ inputs[matrix.pkg] }}
if: inputs[matrix.pkg] != 'skip'
uses: ./.github/actions/build-wheel
with:
pkg: ${{ matrix.pkg }}
ver: ${{ inputs[matrix.pkg] }}
- name: Download ${{ matrix.pkg }}
if: inputs[matrix.pkg] == 'skip'
uses: ./.github/actions/download-wheel
with:
pkg: ${{ matrix.pkg }}
python: ${{ matrix.python }}
- name: Save ${{ matrix.pkg }} wheel
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.pkg }}
path: ${{ matrix.pkg }}/dist/*
retention-days: 7
test:
needs: build
strategy:
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", "3.12"]
fail-fast: false
uses: ./.github/workflows/test-wheel.yml
with:
pkg: ${{ matrix.pkg }}
ver: ${{ inputs[matrix.pkg] }}
os: ${{ matrix.os }}
python: ${{ matrix.python }}
publish:
# isolate from test, to prevent partial uploads
needs: test
strategy:
matrix:
pkg: ['Spine-Database-API', 'spine-engine', 'spine-items', 'Spine-Toolbox']
# TODO: can this be done w/o a matrix strategy? That will be more atomic.
permissions:
id-token: write
uses: ./.github/workflows/publish-wheel.yml
with:
pkg: ${{ matrix.pkg }}
ver: ${{ inputs[matrix.pkg] }}