-
Notifications
You must be signed in to change notification settings - Fork 2
161 lines (154 loc) · 5.05 KB
/
Copy pathrelease.yml
File metadata and controls
161 lines (154 loc) · 5.05 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
name: Release
on:
push:
tags:
- 'v*'
permissions:
contents: write
id-token: write
concurrency:
group: release-${{ github.ref }}
cancel-in-progress: false
jobs:
preflight:
name: Release Preflight
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
- run: pnpm install --no-frozen-lockfile
- name: Verify tag matches package version
run: |
VERSION=$(node -e "console.log(require('./packages/cli/package.json').version)")
test "v$VERSION" = "$GITHUB_REF_NAME"
- run: pnpm version:check
publish-platform:
name: Publish ${{ matrix.package_slug }}
needs: preflight
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-22.04
package_slug: coder-studio-linux-x64
- os: macos-latest
package_slug: coder-studio-darwin-arm64
- os: macos-15-intel
package_slug: coder-studio-darwin-x64
- os: windows-latest
package_slug: coder-studio-win32-x64
steps:
- uses: actions/checkout@v4
- if: startsWith(matrix.os, 'ubuntu')
name: Install Linux build dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
build-essential \
curl \
file \
musl-tools \
wget
- uses: dtolnay/rust-toolchain@stable
- if: startsWith(matrix.os, 'ubuntu')
name: Install Linux musl target
run: rustup target add x86_64-unknown-linux-musl
- uses: Swatinem/rust-cache@v2
with:
workspaces: apps/server -> .build/server/target
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
registry-url: 'https://registry.npmjs.org'
- if: startsWith(matrix.os, 'ubuntu')
name: Use Linux musl release target
run: echo "CODER_STUDIO_RUST_TARGET=x86_64-unknown-linux-musl" >> "$GITHUB_ENV"
- run: pnpm install --no-frozen-lockfile
- run: pnpm release:check
- run: 'node -e "require(''fs'').mkdirSync(''.artifacts'', { recursive: true })"'
- run: pnpm --dir .build/stage/npm/${{ matrix.package_slug }} pack --pack-destination ../../../../.artifacts
- run: npm publish .build/stage/npm/${{ matrix.package_slug }} --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.package_slug }}
path: .artifacts/*.tgz
if-no-files-found: error
include-hidden-files: true
publish-main:
name: Publish @spencer-kit/coder-studio
needs:
- preflight
- publish-platform
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Install Linux build dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
build-essential \
curl \
file \
musl-tools \
wget
- uses: dtolnay/rust-toolchain@stable
- name: Install Linux musl target
run: rustup target add x86_64-unknown-linux-musl
- uses: Swatinem/rust-cache@v2
with:
workspaces: apps/server -> .build/server/target
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
registry-url: 'https://registry.npmjs.org'
- name: Use Linux musl release target
run: echo "CODER_STUDIO_RUST_TARGET=x86_64-unknown-linux-musl" >> "$GITHUB_ENV"
- run: pnpm install --no-frozen-lockfile
- run: pnpm release:check
- run: 'node -e "require(''fs'').mkdirSync(''.artifacts'', { recursive: true })"'
- run: pnpm --dir .build/stage/npm/coder-studio pack --pack-destination ../../../../.artifacts
- run: npm publish .build/stage/npm/coder-studio --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- uses: actions/upload-artifact@v4
with:
name: coder-studio-main
path: .artifacts/*.tgz
if-no-files-found: error
include-hidden-files: true
github-release:
name: Create GitHub Release
needs:
- publish-platform
- publish-main
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 22
- uses: actions/download-artifact@v4
with:
path: .release-artifacts
merge-multiple: true
- run: node scripts/release/write-release-manifest.mjs .release-artifacts
- uses: softprops/action-gh-release@v2
with:
files: |
.release-artifacts/*.tgz
.release-artifacts/release-manifest.json
.release-artifacts/SHA256SUMS.txt