-
Notifications
You must be signed in to change notification settings - Fork 42
117 lines (106 loc) · 3.81 KB
/
release.yml
File metadata and controls
117 lines (106 loc) · 3.81 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: Release
concurrency:
group: release-from-${{ github.ref_name }}
cancel-in-progress: true
on:
workflow_dispatch:
push:
branches:
- "main"
- "release/v[0-9][0-9].[0-9][0-9].[0-9][0-9]"
tags:
- "v[0-9][0-9].[0-9][0-9].[0-9][0-9]"
jobs:
check-event:
name: Check GH Event
runs-on: ubuntu-latest
outputs:
ok: ${{ steps.check_gh_event.outputs.ok }}
steps:
- id: check_gh_event
name: Check GH Event
shell: bash
run: |
[[ '${{ github.event_name }}' == 'workflow_dispatch' ]] || \
[[ '${{ github.event_name }}' == 'push' && '${{ github.repository }}' == 'rapidsai/devcontainers' ]] || \
[[ '${{ github.event_name }}' == 'schedule' && '${{ github.repository }}' == 'rapidsai/devcontainers' ]] || \
[[ '${{ github.event_name }}' == 'pull_request' && '${{ github.repository }}' != 'rapidsai/devcontainers' ]] \
&& echo "ok=true" | tee -a "$GITHUB_OUTPUT" \
|| echo "ok=false" | tee -a "$GITHUB_OUTPUT";
features-matrix:
name: Determine features matrix
if: needs.check-event.outputs.ok == 'true'
needs: check-event
runs-on: ubuntu-latest
outputs:
features: "${{ steps.matrix.outputs.features }}"
scenarios: "${{ steps.matrix.outputs.scenarios }}"
steps:
- name: "Checkout ${{ github.repository }}"
uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false
- name: Copy common scripts into features
uses: ./.github/actions/copy-common-scripts
- id: matrix
name: Determine features matrix
uses: ./.github/actions/feature-matrix
with:
full_matrix: "${{ github.event_name == 'workflow_dispatch' && 'true' || 'false' }}"
image-matrix:
name: Determine image matrix
needs: features-matrix
runs-on: ubuntu-latest
outputs:
linux: ${{ steps.matrix.outputs.linux }}
windows: ${{ steps.matrix.outputs.windows }}
steps:
- name: Checkout ${{ github.repository }}
uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false
- id: matrix
name: Determine image matrix
uses: ./.github/actions/image-matrix
with:
features: "${{ needs.features-matrix.outputs.features }}"
scenarios: "${{ needs.features-matrix.outputs.scenarios }}"
full_matrix: "${{ github.event_name == 'workflow_dispatch' && 'true' || 'false' }}"
release-linux:
if: needs.image-matrix.outputs.linux != '{"include":[]}'
name: ${{ matrix.name || 'Linux' }}
needs: image-matrix
secrets: inherit
uses: ./.github/workflows/build-test-and-push-linux-image.yml
strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.image-matrix.outputs.linux) }}
with:
push: true
os: "${{ matrix.os }}"
features: "${{ toJSON(matrix.features) }}"
container_env: "${{ toJSON(matrix.env) }}"
repo: "${{ vars.DOCKERHUB_REPOSITORY || github.repository }}"
release-windows:
if: needs.image-matrix.outputs.windows != '{"include":[]}'
name: ${{ matrix.name || 'Windows' }}
needs: image-matrix
secrets: inherit
uses: ./.github/workflows/build-test-and-push-windows-image.yml
strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.image-matrix.outputs.windows) }}
with:
push: true
os: "${{ matrix.os }}"
features: "${{ toJSON(matrix.features) }}"
container_env: "${{ toJSON(matrix.env) }}"
repo: "${{ vars.DOCKERHUB_REPOSITORY || github.repository }}"
release-features:
if: needs.features-matrix.outputs.features != '[]' || needs.features-matrix.outputs.scenarios != '[]'
name: Features
needs: features-matrix
secrets: inherit
uses: ./.github/workflows/release-features.yml