forked from shauninman/MinUI
-
Notifications
You must be signed in to change notification settings - Fork 60
164 lines (139 loc) · 4 KB
/
ci.yaml
File metadata and controls
164 lines (139 loc) · 4 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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
---
name: CI
# yamllint disable-line rule:truthy
on:
push:
branches:
- main
pull_request: {}
permissions:
attestations: write
contents: read
id-token: write
jobs:
prepare:
runs-on: ubuntu-24.04-arm
outputs:
next-tag: ${{ steps.next-tag.outputs.version }}
release-name: ${{ steps.release-name.outputs.RELEASE_NAME }}
steps:
- name: Checkout
uses: actions/checkout@v4.2.2
with:
fetch-depth: 0
- name: Generate Release Name
id: release-name
run: |
echo "RELEASE_NAME=$(make name)" >> "$GITHUB_OUTPUT"
core-matrix:
runs-on: ubuntu-24.04-arm
env:
PLATFORM: ${{ matrix.toolchain }}
outputs:
cores: ${{ steps.cores.outputs.cores }}
strategy:
fail-fast: true
matrix:
toolchain:
- tg5040
- tg5050
steps:
- name: Checkout
uses: actions/checkout@v4.2.2
- name: Generate cores matrix
id: cores
run: |
CORES="$(make cores-json)"
echo "cores=$CORES" >> $GITHUB_OUTPUT
build-core:
needs: core-matrix
runs-on: ubuntu-24.04-arm
env:
PLATFORM: ${{ matrix.toolchain }}
strategy:
fail-fast: true
matrix:
toolchain:
- tg5040
- tg5050
core: ${{ fromJson(needs.core-matrix.outputs.cores) }}
steps:
- name: Checkout
uses: actions/checkout@v4.2.2
- name: Setup
run: make setup
- name: Build ${{ matrix.core }} core
run: make build-core CORE=${{ matrix.core }}
- name: Upload core
uses: actions/upload-artifact@v4.6.2
with:
name: core-${{ matrix.toolchain }}-${{ matrix.core }}.zip
path: workspace/${{ env.PLATFORM }}/cores/output/
build:
needs:
- prepare
- build-core
runs-on: ubuntu-24.04-arm
env:
RELEASE_NAME: ${{ needs.prepare.outputs.release-name }}
steps:
- name: Checkout
uses: actions/checkout@v4.2.2
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y zipmerge
- name: Setup
run: make setup
- name: Download Cores (tg5040)
uses: actions/download-artifact@v4.3.0
with:
path: workspace/tg5040/cores/output/
pattern: core-tg5040-*
merge-multiple: true
- name: Build (tg5040)
run: make tg5040
env:
PLATFORM: tg5040
- name: Download Cores (tg5050)
uses: actions/download-artifact@v4.3.0
with:
path: workspace/tg5050/cores/output/
pattern: core-tg5050-*
merge-multiple: true
- name: Build (tg5050)
run: make tg5050
env:
PLATFORM: tg5050
- name: Special
run: make special
- name: Package
run: make package
- name: Upload All
uses: actions/upload-artifact@v4.6.2
with:
name: ${{ env.RELEASE_NAME }}-all.zip
path: releases/${{ env.RELEASE_NAME }}-all.zip
- name: Upload Base
uses: actions/upload-artifact@v4.6.2
with:
name: ${{ env.RELEASE_NAME }}-base.zip
path: releases/${{ env.RELEASE_NAME }}-base.zip
- name: Upload Extras
uses: actions/upload-artifact@v4.6.2
with:
name: ${{ env.RELEASE_NAME }}-extras.zip
path: releases/${{ env.RELEASE_NAME }}-extras.zip
- name: Skip Attest for PRs from forks
id: skip
if: github.ref != 'refs/heads/main'
run: |
echo '::warning title=Attest skipped::Attest action requires permissions and is performed only for main branch.'
- name: Attest Build Provenance
uses: actions/attest-build-provenance@v2.3.0
if: github.ref == 'refs/heads/main'
with:
subject-path: |
releases/${{ env.RELEASE_NAME }}-all.zip
releases/${{ env.RELEASE_NAME }}-base.zip
releases/${{ env.RELEASE_NAME }}-extras.zip