-
Notifications
You must be signed in to change notification settings - Fork 2
117 lines (110 loc) · 4.7 KB
/
devel-sofa-python3.yml
File metadata and controls
117 lines (110 loc) · 4.7 KB
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
name: devel-sofa-python3
on:
workflow_call:
inputs:
git-sha:
description: 'Git commit SHA1'
required: true
type: string
git-commit-date:
description: 'Git commit date'
required: true
type: string
sofa-git-sha:
description: 'SOFA Git commit SHA1'
required: true
type: string
workflow_dispatch:
inputs:
git-sha:
description: 'Git commit SHA1'
required: true
type: string
default: 'master'
git-commit-date:
description: 'Git commit date'
required: true
type: string
default: 'NODATE' # for testing
sofa-git-sha:
description: 'SOFA Git commit SHA1'
required: true
type: string
repository_dispatch:
types: [build-devel-sofa-python3]
pull_request:
types:
- opened
- reopened
- unlabeled
- closed
paths:
- '**/devel/sofa-python3/.ci_support/*.yaml'
jobs:
check-depends-on-PR:
runs-on: ubuntu-latest
# skip if event is closing PR without merging
if: ${{ !(github.event.action == 'closed' && github.event_name == 'pull_request' && github.event.pull_request.merged == false) }}
steps:
- name: Fail in case Pull Request is opened with label "depends-on"
if: ${{ contains(github.event.pull_request.labels.*.name, 'depends-on') }}
run: |
echo "Pull Request was open with a depends-on label and is blocked."
echo "Merge listed PRs in comment first and unlabel this PR."
exit 1
- name: Succeed otherwise
if: ${{ !contains(github.event.pull_request.labels.*.name, 'depends-on') }}
run: |
echo "Pull Request was not opened with a depends-on label, continuing..."
extract-params:
runs-on: ubuntu-latest
outputs:
git-sha: ${{ steps.params.outputs.git-sha }}
git-commit-date: ${{ steps.params.outputs.git-commit-date }}
sofa-git-sha: ${{ steps.params.outputs.sofa-git-sha }}
steps:
- name: Extract parameters
id: params
run: |
if [[ "${{ github.event_name }}" == "workflow_dispatch" || "${{ github.event_name }}" == "workflow_call" ]]; then
echo "git-sha=${{ inputs.git-sha }}" >> $GITHUB_OUTPUT
echo "git-commit-date=${{ inputs.git-commit-date }}" >> $GITHUB_OUTPUT
echo "sofa-git-sha=${{ inputs.sofa-git-sha }}" >> $GITHUB_OUTPUT
elif [[ "${{ github.event_name }}" == "repository_dispatch" ]]; then
echo "git-sha=${{ github.event.client_payload.sofa_python3_commit_hash }}" >> $GITHUB_OUTPUT
echo "git-commit-date=${{ github.event.client_payload.sofa_python3_commit_date }}" >> $GITHUB_OUTPUT
echo "sofa-git-sha=${{ github.event.client_payload.sofa_commit_hash }}" >> $GITHUB_OUTPUT
fi
- name: Check parameters
run: |
echo "✓ git-sha: ${{ steps.params.outputs.git-sha }}"
echo "✓ git-commit-date: ${{ steps.params.outputs.git-commit-date }}"
echo "✓ sofa-git-sha: ${{ steps.params.outputs.sofa-git-sha }}"
build-publish-sofa-python3:
strategy:
fail-fast: false
matrix:
target: [{platform: "linux-64", runner: "ubuntu-latest"},
{platform: "linux-aarch64", runner: "ubuntu-24.04-arm"},
{platform: "osx-64", runner: "macos-15-intel"},
{platform: "osx-arm64", runner: "macos-latest"},
{platform: "win-64", runner: "windows-latest"}]
python: ["3.10", "3.12"]
uses: ./.github/workflows/build_publish_package.yml
# skip if event is closing PR without merging
if: ${{ !(github.event.action == 'closed' && github.event_name == 'pull_request' && github.event.pull_request.merged == false) }}
needs: [check-depends-on-PR, extract-params]
with:
package-name: sofa-python3
runner: ${{ matrix.target.runner }}
platform: ${{ matrix.target.platform }}
python: ${{ matrix.python }}
channel: sofa-framework-devel
recipe-dir: devel
# only publish packages on pull request merging OR when called manually through workflow_dispatch OR workflow call OR repository_dispatch
publish-package: ${{ (github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged == true) || github.event_name == 'workflow_dispatch' || github.event_name == 'workflow_call' || github.event_name == 'repository_dispatch' }}
git-sha: ${{ needs.extract-params.outputs.git-sha }}
git-commit-date: ${{ needs.extract-params.outputs.git-commit-date }}
sofa-git-sha: ${{ needs.extract-params.outputs.sofa-git-sha }}
secrets:
api-key: ${{ secrets.PREFIXDEV_APIKEY }}