-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
114 lines (99 loc) · 2.84 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
name: "Publish"
env:
GIT_AUTHOR_NAME: "SWC Bot"
GIT_AUTHOR_EMAIL: "bot@swc.rs"
GIT_COMMITTER_NAME: "SWC Bot"
GIT_COMMITTER_EMAIL: "bot@swc.rs"
# https://github.com/actions/setup-node/issues/899#issuecomment-1819151595
SKIP_YARN_COREPACK_CHECK: 1
on:
pull_request:
types: ["opened", "reopened", "synchronize"]
workflow_dispatch:
inputs:
version:
description: "Version to publish"
required: true
type: string
tag:
description: "Tag to publish"
required: true
type: string
onlyNightly:
description: "Publish only nightly"
required: false
type: boolean
default: false
allowBreakingWasm:
description: "Allow breaking changes in wasm"
required: false
type: boolean
default: false
concurrency:
group: "publish"
cancel-in-progress: true
jobs:
publish-cargo:
name: "Publish cargo crates"
runs-on: ubuntu-latest
steps:
- uses: ./.github/actions/setup-node
with:
node-version: 20
- uses: actions/checkout@v4
- uses: actions-rs/toolchain@v1
with:
profile: minimal
- name: Install cargo-edit
uses: baptiste0928/cargo-install@v2.2.0
with:
crate: cargo-edit
version: "0.12.2"
locked: true
- name: Install cargo-mono
uses: baptiste0928/cargo-install@v2.2.0
with:
crate: cargo-mono
version: "0.3.7"
locked: true
- name: Update constant of swc_core
run: npx ts-node scripts/bot/src/cargo/update-constants.ts
- name: Publish crates
# Skip on pull requests
if: github.event_name == 'workflow_dispatch'
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
run: |
cargo mono publish --no-verify
cargo mono publish --no-verify
cargo mono publish --no-verify
cargo mono publish --no-verify
cargo mono publish --no-verify
cargo mono publish --no-verify
cargo mono publish --no-verify
cargo mono publish --no-verify
cargo mono publish --no-verify
cargo mono publish --no-verify
publish-npm-nightly:
name: "Publish nightly to npm"
needs:
- publish-cargo
uses: ./.github/workflows/publish-npm-package.yml
with:
package: "core"
version: "${{ github.event.inputs.version }} || '1.6.0-nightly.20240616.1'"
build-cli: true
test-nightly-ecosystem:
name: "Test nightly using ecosystem CI"
runs-on: ubuntu-latest
needs:
- publish-npm-nightly
steps:
- uses: actions/checkout@v4
publish-npm-stable:
name: "Publish stable to npm"
runs-on: ubuntu-latest
needs:
- test-nightly-ecosystem
steps:
- uses: actions/checkout@v4