-
Notifications
You must be signed in to change notification settings - Fork 1
90 lines (83 loc) · 2.54 KB
/
test-n-publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
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] }}