-
-
Notifications
You must be signed in to change notification settings - Fork 19
191 lines (158 loc) · 4.51 KB
/
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
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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
name: Publish on AMO
on:
push:
tags:
- v*.*.*
jobs:
publish:
name: Publish web extension
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Node.js
uses: actions/setup-node@v4
with:
cache: npm
- name: Install dependencies
run: npm ci
- name: Build web extension source
run: npm run build
env:
WEB_EXT_FILENAME: icloud_passwords.zip
- name: Upload web extension source
uses: actions/upload-artifact@v4
with:
name: web-ext-source
path: ./web-ext-artifacts/icloud_passwords.zip
compression-level: 0
- name: Submit web extension
run: npx web-ext sign
env:
WEB_EXT_USE_SUBMISSION_API: true
WEB_EXT_CHANNEL: listed
WEB_EXT_API_KEY: ${{ vars.WEB_EXT_API_KEY }}
WEB_EXT_API_SECRET: ${{ secrets.WEB_EXT_API_SECRET }}
WEB_EXT_NO_INPUT: true
- name: Rename signed web extension file
working-directory: ./web-ext-artifacts
run: mv *.xpi icloud_passwords.xpi
- name: Upload signed web extension
uses: actions/upload-artifact@v4
with:
name: web-ext
path: ./web-ext-artifacts/icloud_passwords.xpi
compression-level: 0
helpers:
name: Build install helpers
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v5
with:
cache-dependency-path: ./scripts/install/go.sum
- name: Build install helper
working-directory: ./scripts/install
run: ./build.sh
- name: Upload install helper artifact
uses: actions/upload-artifact@v4
with:
name: web-ext-install-helpers
path: ./scripts/install/dist/*
release:
name: Release on GitHub
runs-on: ubuntu-latest
needs:
- publish
- helpers
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: ./web-ext-artifacts
merge-multiple: true
- name: Create GitHub release
run: |
if gh release view "${{ github.ref_name }}" >/dev/null 2>&1
then
echo "Release ${{ github.ref_name }} already exists, skipping..."
exit 0
fi
gh release create \
"${{ github.ref_name }}" \
--title "${{ github.ref_name }}" \
--verify-tag
env:
GH_TOKEN: ${{ github.token }}
- name: Attach artifacts to release
run: |
gh release upload \
"${{ github.ref_name }}" \
./web-ext-artifacts/* \
--clobber
env:
GH_TOKEN: ${{ github.token }}
provenance:
name: Attest build provenance
runs-on: ubuntu-latest
needs:
- release
permissions:
contents: write
id-token: write
attestations: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download artifacts to attest
uses: actions/download-artifact@v4
with:
pattern: web-ext-*
path: ./web-ext-artifacts
merge-multiple: true
- name: Generate artifact attestation
id: attestation
uses: actions/attest-build-provenance@v1
with:
subject-path: ./web-ext-artifacts
- name: Attach bundle to release
run: |
gh release upload \
"${{ github.ref_name }}" \
${{ steps.attestation.outputs.bundle-path }} \
--clobber
env:
GH_TOKEN: ${{ github.token }}
sbom:
name: Attest SBOM
runs-on: ubuntu-latest
needs:
- release
permissions:
contents: write
id-token: write
attestations: write
steps:
- name: Download artifacts to attest
uses: actions/download-artifact@v4
with:
pattern: web-ext-*
path: ./web-ext-artifacts
merge-multiple: true
- name: Generate SBOM
uses: anchore/sbom-action@v0
with:
path: ./web-ext-artifacts
upload-artifact: false
output-file: ./sbom.spdx.json
- name: Generate SBOM attestation
uses: actions/attest-sbom@v1
with:
subject-path: ./web-ext-artifacts
sbom-path: ./sbom.spdx.json