223 lines (180 loc) · 6.18 KB
/
release.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
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
name: Release
on:
workflow_call:
jobs:
build_android:
uses: ./.github/workflows/build-android.yml
secrets: inherit
build_linux:
uses: ./.github/workflows/build-linux.yml
secrets: inherit
build_linux_musl:
uses: ./.github/workflows/build-linux-musl.yml
secrets: inherit
build_macos:
uses: ./.github/workflows/build-macos.yml
secrets: inherit
build_windows:
uses: ./.github/workflows/build-windows.yml
secrets: inherit
release_github:
name: Release Github
runs-on: ubuntu-latest
needs: [build_android, build_linux, build_linux_musl, build_macos, build_windows]
steps:
- uses: actions/checkout@v4
- uses: ./.github/util/initialize
with: {github-token: "${{ github.token }}"}
- name: Deploy
run: dart run grinder pkg-github-release
env:
GH_TOKEN: "${{ secrets.GH_TOKEN }}"
GH_USER: sassbot
deploy_github:
name: Deploy Github
runs-on: ubuntu-latest
needs: [release_github]
permissions:
contents: write
steps:
- name: Download Artifact
uses: actions/download-artifact@v4
- name: Release
uses: softprops/action-gh-release@v2
with:
files: |
build-*/*
deploy_npm:
name: Deploy npm
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/util/initialize
with: {github-token: "${{ github.token }}"}
- name: Deploy
run: dart run grinder pkg-npm-deploy
env:
UPDATE_SASS_SASS_REPO: false
NPM_TOKEN: "${{ secrets.NPM_TOKEN }}"
deploy_bazel:
name: Deploy Bazel
runs-on: ubuntu-latest
needs: [deploy_npm]
steps:
- uses: actions/checkout@v4
- uses: ./.github/util/initialize
with: {github-token: "${{ github.token }}"}
- name: Deploy
run: dart run grinder update-bazel
env:
GH_TOKEN: "${{ secrets.GH_TOKEN }}"
GH_USER: sassbot
deploy_pub:
name: Deploy Pub
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/util/initialize
with: {github-token: "${{ github.token }}"}
- name: Deploy
run: dart run grinder protobuf pkg-pub-deploy
env: {PUB_CREDENTIALS: "${{ secrets.PUB_CREDENTIALS }}"}
deploy_sub_packages:
name: Deploy Sub-Packages
runs-on: ubuntu-latest
needs: [deploy_pub]
steps:
- uses: actions/checkout@v4
- uses: ./.github/util/initialize
with: {github-token: "${{ github.token }}"}
- name: Deploy
run: dart run grinder deploy-sub-packages
env:
PUB_CREDENTIALS: "${{ secrets.PUB_CREDENTIALS }}"
GH_TOKEN: "${{ secrets.GH_TOKEN }}"
GH_USER: sassbot
deploy_homebrew:
name: Deploy Homebrew
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dart-lang/setup-dart@v1
- run: dart pub get
- name: Deploy
run: dart run grinder pkg-homebrew-update
env:
GH_TOKEN: "${{ secrets.GH_TOKEN }}"
GH_USER: sassbot
deploy_chocolatey:
name: Deploy Chocolatey
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/util/initialize
with: {github-token: "${{ github.token }}"}
- name: Deploy
run: dart run grinder pkg-chocolatey-deploy
env: {CHOCOLATEY_TOKEN: "${{ secrets.CHOCOLATEY_TOKEN }}"}
deploy_website:
name: Deploy sass-lang.com
runs-on: ubuntu-latest
needs: [deploy_npm]
steps:
- uses: actions/checkout@v4
with:
repository: sass/sass-site
token: ${{ secrets.SASS_SITE_TOKEN }}
- name: Get version
id: version
run: echo "version=${GITHUB_REF##*/}" | tee --append "$GITHUB_OUTPUT"
- name: Wait for npm registry's CDN to catch up on replications
run: sleep 600
- name: Update Dart Sass version
run: npm install sass@${{ steps.version.outputs.version }}
- uses: EndBug/add-and-commit@v9
with:
author_name: Sass Bot
author_email: sass.bot.beep.boop@gmail.com
message: Cut a release for a new Dart Sass version
commit: --allow-empty
release_embedded_host:
name: Release Embedded Host
runs-on: ubuntu-latest
needs: [deploy_github]
steps:
- uses: actions/checkout@v4
with:
repository: sass/embedded-host-node
token: ${{ secrets.GH_TOKEN }}
- name: Get version
id: version
run: |
echo "version=${GITHUB_REF##*/}" | tee --append "$GITHUB_OUTPUT"
echo "protocol_version=$(curl -fsSL -H "Authorization: Bearer ${{ github.token }}" https://raw.githubusercontent.com/sass/sass/HEAD/spec/EMBEDDED_PROTOCOL_VERSION)" | tee --append "$GITHUB_OUTPUT"
- name: Update version
run: |
# Update binary package versions
for dir in $(ls npm); do
cat "npm/$dir/package.json" |
jq --arg version ${{ steps.version.outputs.version }} '
.version |= $version
' > package.json.tmp &&
mv package.json.tmp "npm/$dir/package.json"
done
# Update main package version and dependencies on binary packages
cat package.json |
jq --arg version ${{ steps.version.outputs.version }} --arg protocol_version ${{ steps.version.outputs.protocol_version }} '
.version |= $version |
."compiler-version" |= $version |
."protocol-version" |= $protocol_version |
.optionalDependencies = (.optionalDependencies | .[] |= $version)
' > package.json.tmp &&
mv package.json.tmp package.json
curl -fsSL -H "Authorization: Bearer ${{ github.token }}" https://raw.githubusercontent.com/sass/dart-sass/${{ steps.version.outputs.version }}/CHANGELOG.md > CHANGELOG.md
shell: bash
- uses: EndBug/add-and-commit@v9
with:
author_name: Sass Bot
author_email: sass.bot.beep.boop@gmail.com
message: Update Dart Sass version and release
tag: ${{ steps.version.outputs.version }}