@@ -14,8 +14,7 @@ name: Turborepo Release
14
14
15
15
env :
16
16
CARGO_PROFILE_RELEASE_LTO : true
17
- NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
18
- RELEASE_TURBO_CLI : true # TODO: do we need this?
17
+ # NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
19
18
20
19
on :
21
20
workflow_dispatch :
38
37
type : boolean
39
38
40
39
jobs :
41
- stage :
40
+ bump-version :
42
41
runs-on : ubuntu-latest
43
42
steps :
44
43
- uses : actions/checkout@v3
@@ -52,25 +51,15 @@ jobs:
52
51
- name : Version
53
52
run : |
54
53
./scripts/version.js ${{ inputs.increment }}
55
- cat version.txt
56
- - name : Stage Commit
57
- id : stage
58
- run : cd cli && make stage-release && echo "STAGE_BRANCH=$(git branch --show-current)" >> $GITHUB_OUTPUT
59
- - name : Show Stage Commit
60
- run : echo "${{ steps.stage.outputs.STAGE_BRANCH }}"
54
+ echo "VERSION=$(cat version.txt)" >> $GITHUB_OUTPUT
61
55
outputs :
62
- stage-branch : " ${{ steps.stage .outputs.STAGE_BRANCH }}"
56
+ version : " ${{ steps.bump-version .outputs.VERSION }}"
63
57
64
58
rust-smoke-test :
65
59
name : Rust Unit Tests
66
60
runs-on : ubuntu-latest
67
- needs : [stage ]
61
+ needs : [bump-version ]
68
62
steps :
69
- - name : Show Stage Commit
70
- run : echo "${{ needs.stage.outputs.stage-branch }}"
71
- - uses : actions/checkout@v3
72
- with :
73
- ref : ${{ needs.stage.outputs.stage-branch }}
74
63
- name : Setup Turborepo Environment
75
64
uses : ./.github/actions/setup-turborepo-environment
76
65
with :
82
71
js-smoke-test :
83
72
name : JS Package Tests
84
73
runs-on : ubuntu-latest
85
- needs : [stage ]
74
+ needs : [bump-version ]
86
75
steps :
87
- - name : Show Stage Commit
88
- run : echo "${{ needs.stage.outputs.stage-branch }}"
89
- - uses : actions/checkout@v3
90
- with :
91
- ref : ${{ needs.stage.outputs.stage-branch }}
92
76
- name : Setup Turborepo Environment
93
77
uses : ./.github/actions/setup-turborepo-environment
94
78
with :
@@ -98,168 +82,23 @@ jobs:
98
82
uses : ./.github/actions/install-global-turbo
99
83
- name : Run JS Package Tests
100
84
run : turbo run check-types test --filter="./packages/*" --color
101
-
102
- build-rust :
103
- name : " Build Rust"
104
- needs : [stage, rust-smoke-test, js-smoke-test]
105
- strategy :
106
- fail-fast : false
107
- matrix :
108
- settings :
109
- - host : macos-latest
110
- target : " x86_64-apple-darwin"
111
- container-options : " --rm"
112
- - host : macos-latest
113
- target : " aarch64-apple-darwin"
114
- container-options : " --rm"
115
- - host : ubuntu-latest
116
- container : ubuntu:xenial
117
- container-options : " --platform=linux/amd64 --rm"
118
- container-setup : " apt-get update && apt-get install -y curl musl-tools sudo unzip"
119
- target : " x86_64-unknown-linux-musl"
120
- setup : " apt-get install -y build-essential clang-5.0 lldb-5.0 llvm-5.0-dev libclang-5.0-dev"
121
- - host : ubuntu-latest
122
- container-options : " --rm"
123
- target : " aarch64-unknown-linux-musl"
124
- rust-build-env : ' CC_aarch64_unknown_linux_musl=clang AR_aarch64_unknown_linux_musl=llvm-ar RUSTFLAGS="-Clink-self-contained=yes -Clinker=rust-lld"'
125
- setup : " sudo apt-get update && sudo apt-get install -y build-essential musl-tools clang llvm gcc-aarch64-linux-gnu binutils-aarch64-linux-gnu"
126
- - host : windows-latest
127
- target : x86_64-pc-windows-gnu
128
- setup : " rustup set default-host x86_64-pc-windows-gnu"
129
- container-options : " --rm"
130
- runs-on : ${{ matrix.settings.host }}
131
- container :
132
- image : ${{ matrix.settings.container }}
133
- options : ${{ matrix.settings.container-options }}
134
- steps :
135
- - name : Show Stage Commit
136
- run : echo "${{ needs.stage.outputs.stage-branch }}"
137
- - name : Checkout repo
138
- uses : actions/checkout@v3
139
- with :
140
- ref : " ${{ needs.stage.outputs.stage-branch }}"
141
-
142
- - name : Setup Container
143
- if : ${{ matrix.settings.container-setup }}
144
- run : ${{ matrix.settings.container-setup }}
145
-
146
- - name : Setup Protoc
147
-
148
- with :
149
- version : " 26.x"
150
- repo-token : ${{ secrets.GITHUB_TOKEN }}
151
-
152
- - name : Setup capnproto
153
- uses : ./.github/actions/setup-capnproto
154
-
155
- - name : Setup Rust Up
156
- if : ${{ matrix.settings.container-setup }}
157
- # setup-rust-toolchain uses the --retry-connrefused flag with curl to install rustup
158
- # this flag was added in curl 7.52.0, but the Ubuntu version we use only has 7.47.0
159
- run : |
160
- curl --proto '=https' --tlsv1.2 --retry 10 --location --silent --show-error --fail "https://sh.rustup.rs" | sh -s -- --default-toolchain none -y
161
- echo "${CARGO_HOME:-$HOME/.cargo}/bin" >> $GITHUB_PATH
162
-
163
- - name : Rust Setup
164
- uses : actions-rust-lang/setup-rust-toolchain@v1
165
- with :
166
- target : ${{ matrix.settings.target }}
167
- # needed to not make it override the defaults
168
- rustflags : " "
169
- # we want more specific settings
170
- cache : false
171
-
172
- - name : Build Setup
173
- shell : bash
174
- if : ${{ matrix.settings.setup }}
175
- run : ${{ matrix.settings.setup }}
176
-
177
- - name : Build
178
- run : ${{ matrix.settings.rust-build-env }} cargo build --profile release-turborepo -p turbo --target ${{ matrix.settings.target }}
179
-
180
- - name : Upload Artifacts
181
- uses : actions/upload-artifact@v3
182
- with :
183
- name : turbo-${{ matrix.settings.target }}
184
- path : target/${{ matrix.settings.target }}/release-turborepo/turbo*
185
-
186
- npm-publish :
187
- name : " Publish To NPM"
85
+ make-release-pr :
86
+ needs : [bump-version, rust-smoke-test, js-smoke-test]
87
+ permissions :
88
+ id-token : write # Enable OIDC
89
+ pull-requests : write
90
+ contents : write
188
91
runs-on : ubuntu-latest
189
- needs : [stage, build-rust]
190
92
steps :
191
- - name : Show Stage Commit
192
- run : echo "${{ needs.stage.outputs.stage-branch }}"
193
93
- uses : actions/checkout@v3
94
+ - uses : chainguard-dev/actions/setup-gitsign@main
95
+ - name : Install cargo-release
96
+ uses : taiki-e/install-action@v1
194
97
with :
195
- ref : " ${{ needs.stage.outputs.stage-branch }}"
196
- - run : git fetch origin --tags
197
- - uses : ./.github/actions/setup-node
198
- with :
199
- enable-corepack : false
200
-
201
- - name : Install Global Turbo
202
- uses : ./.github/actions/install-global-turbo
203
-
204
- - name : Configure git
205
- run : |
206
- git config --global user.name 'Turbobot'
207
- git config --global user.email '[email protected] '
208
-
209
- - name : Install GoReleaser
210
- uses : goreleaser/goreleaser-action@v3
211
- with :
212
- distribution : goreleaser-pro
213
- version : v1.18.2
214
- install-only : true
215
- env :
216
- GORELEASER_KEY : ${{ secrets.GORELEASER_KEY }}
98
+ tool : cargo-release
217
99
218
- - name : Download Rust artifacts
219
- uses : actions/download-artifact@v3
220
- with :
221
- path : rust-artifacts
222
-
223
- - name : Move Rust artifacts into place
224
- run : |
225
- mv rust-artifacts/turbo-aarch64-apple-darwin cli/dist-darwin-arm64
226
- mv rust-artifacts/turbo-aarch64-unknown-linux-musl cli/dist-linux-arm64
227
- cp -r rust-artifacts/turbo-x86_64-pc-windows-gnu cli/dist-windows-arm64
228
- mv rust-artifacts/turbo-x86_64-unknown-linux-musl cli/dist-linux-amd64
229
- mv rust-artifacts/turbo-x86_64-apple-darwin cli/dist-darwin-amd64
230
- mv rust-artifacts/turbo-x86_64-pc-windows-gnu cli/dist-windows-amd64
231
-
232
- - name : Perform Release
233
- run : cd cli && make publish-turbo SKIP_PUBLISH=${{ inputs.dry_run && '--skip-publish' || '' }}
234
- env :
235
- GORELEASER_KEY : ${{ secrets.GORELEASER_KEY }}
236
- NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
237
-
238
- # Upload published artifacts in case they are needed for debugging later
239
- - name : Upload Artifacts
240
- uses : actions/upload-artifact@v3
241
- with :
242
- name : turbo-combined
243
- path : cli/dist
244
-
245
- create-release-pr :
246
- name : " Open Release Branch PR"
247
- needs : [stage, npm-publish]
248
- runs-on : ubuntu-latest
249
- steps :
250
- - name : Show Stage Commit
251
- run : echo "${{ needs.stage.outputs.stage-branch }}"
252
-
253
- with :
254
- ref : ${{ needs.stage.outputs.stage-branch }}
255
- - name : Get version
256
- id : getVersion
257
- run : echo "version=$(head -n 1 version.txt)" >> $GITHUB_OUTPUT
258
- - name : Create pull request
259
- uses : thomaseizinger/create-pull-request@master
260
- if : ${{ !inputs.dry_run }}
100
+ - uses : cargo-bins/release-pr@v2
261
101
with :
262
- github_token : ${{ secrets.GITHUB_TOKEN }}
263
- head : ${{ needs.stage.outputs.stage-branch }}
264
- base : main
265
- title : " release(turborepo): ${{ steps.getVersion.outputs.version }}"
102
+ github-token : ${{ secrets.GITHUB_TOKEN }}
103
+ version : ${{ needs.bump-version.outputs.version }}
104
+ crate-name : turbo
0 commit comments