forked from Gruntfuggly/todo-tree
-
-
Notifications
You must be signed in to change notification settings - Fork 0
190 lines (161 loc) · 5.46 KB
/
Copy pathrelease.yml
File metadata and controls
190 lines (161 loc) · 5.46 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
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
name: Release
on:
push:
tags:
- v*.*.*
workflow_dispatch:
inputs:
tag:
description: Existing version tag to release, e.g. v0.0.225
required: false
type: string
permissions:
contents: read
concurrency:
group: release-${{ github.ref }}
cancel-in-progress: false
jobs:
preflight:
runs-on: ubuntu-24.04
outputs:
tag: ${{ steps.meta.outputs.tag }}
prerelease: ${{ steps.meta.outputs.prerelease }}
release_ref: ${{ steps.meta.outputs.release_ref }}
release_sha: ${{ steps.meta.outputs.release_sha }}
steps:
- name: Check out repository
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10
with:
fetch-depth: 0
- name: Set up Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e
with:
node-version-file: .nvmrc
cache: npm
cache-dependency-path: package-lock.json
- name: Cache upstream parity clone
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae
with:
path: .tools/upstream-todo-tree
key: upstream-todo-tree-7761bd02406a5c5f5bc8da944a561eb3c12a48df
- name: Install dependencies
run: npm ci
- name: Resolve release metadata
id: meta
env:
INPUT_TAG: ${{ inputs.tag }}
REF_NAME: ${{ github.ref_name }}
REF_TYPE: ${{ github.ref_type }}
run: bash scripts/release/resolve-release-metadata.sh
- name: Run release test suite
run: npm test
- name: Build release bundle
run: npm run vscode:prepublish
build:
needs: preflight
uses: ./.github/workflows/reusable-build-vsix.yml
with:
ref: ${{ needs.preflight.outputs.release_ref }}
release_tag: ${{ needs.preflight.outputs.tag }}
targets: '["win32-x64","win32-arm64","linux-x64","linux-arm64","linux-armhf","darwin-x64","darwin-arm64","alpine-x64","alpine-arm64","web"]'
secrets: inherit
publish:
needs:
- preflight
- build
runs-on: ubuntu-24.04
environment: release
permissions:
contents: read
id-token: write
attestations: write
steps:
- name: Check out repository
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10
with:
ref: ${{ needs.preflight.outputs.release_ref }}
- name: Set up Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e
with:
node-version-file: .nvmrc
cache: npm
cache-dependency-path: package-lock.json
- name: Install dependencies
run: npm ci
- name: Download VSIX artifacts
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c
with:
pattern: vsix-*
path: artifacts/release
merge-multiple: true
- name: Publish to VS Code Marketplace
id: publish_vscode_marketplace
env:
VSCE_PAT: ${{ secrets.VSCE_PAT }}
run: bash scripts/release/publish-vscode-marketplace.sh
- name: Publish to Open VSX
id: publish_open_vsx
timeout-minutes: 4320
env:
OVSX_PAT: ${{ secrets.OVSX_PAT }}
OPEN_VSX_RETRY_INTERVAL_SECONDS: 300
run: bash scripts/release/publish-open-vsx.sh
- name: Attest build provenance
uses: actions/attest-build-provenance@a2bbfa25375fe432b6a289bc6b6cd05ecd0c4c32
with:
subject-path: artifacts/release/*.vsix
- name: Record registry publication outcomes
if: always()
run: |
{
echo '## Registry publication'
echo "- VS Code Marketplace: ${{ steps.publish_vscode_marketplace.outcome }}"
echo "- Open VSX: ${{ steps.publish_open_vsx.outcome }}"
} >> "$GITHUB_STEP_SUMMARY"
if [[ "${{ steps.publish_open_vsx.outcome }}" == 'failure' ]]; then
echo '::warning::Open VSX publication failed after VS Code Marketplace publication completed.'
fi
github-release:
needs:
- preflight
- publish
runs-on: ubuntu-24.04
permissions:
contents: write
steps:
- name: Check out repository
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10
with:
fetch-depth: 0
ref: ${{ needs.preflight.outputs.release_ref }}
- name: Download VSIX artifacts
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c
with:
pattern: vsix-*
path: artifacts/release
merge-multiple: true
- name: Create GitHub release
env:
GH_TOKEN: ${{ github.token }}
RELEASE_TAG: ${{ needs.preflight.outputs.tag }}
PRERELEASE: ${{ needs.preflight.outputs.prerelease }}
RELEASE_TARGET_SHA: ${{ needs.preflight.outputs.release_sha }}
run: bash scripts/release/create-github-release.sh
verify-marketplace:
needs:
- preflight
- publish
- github-release
runs-on: ubuntu-24.04
permissions:
contents: read
steps:
- name: Check out repository
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10
with:
fetch-depth: 0
ref: ${{ needs.preflight.outputs.release_ref }}
- name: Verify public VS Code Marketplace publication
env:
RELEASE_TAG: ${{ needs.preflight.outputs.tag }}
run: bash scripts/release/verify-vscode-marketplace.sh