Skip to content

Commit 243376f

Browse files
fix: detach keysale page from operator release
Add on PR workflow
1 parent bcce518 commit 243376f

File tree

4 files changed

+285
-45
lines changed

4 files changed

+285
-45
lines changed
+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Deploy Web Connect
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
build:
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- name: Checkout code
12+
uses: actions/checkout@v4
13+
14+
- name: Setup Node.js
15+
uses: actions/setup-node@v4
16+
with:
17+
node-version: 20
18+
19+
- name: Install pnpm
20+
run: npm install -g pnpm
21+
22+
- name: Install dependencies
23+
run: pnpm install
24+
25+
- name: Build monorepo
26+
run: npx nx run @sentry/web-connect:build
27+
env:
28+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
29+
30+
# Popular action to deploy to GitHub Pages:
31+
# Docs: https://github.com/peaceiris/actions-gh-pages#%EF%B8%8F-docusaurus
32+
- name: Deploy to GitHub Pages
33+
uses: peaceiris/actions-gh-pages@v4
34+
with:
35+
github_token: ${{ secrets.GITHUB_TOKEN }}
36+
# Build output to publish to the `gh-pages` branch:
37+
publish_dir: ./apps/web-connect/dist
38+
# The following lines assign commit authorship to the official
39+
# GH-Actions bot for deploys to `gh-pages` branch:
40+
# https://github.com/actions/checkout/issues/13#issuecomment-724415212
41+
# The GH actions bot is used by default if you didn't specify the two fields.
42+
# You can swap them out with your own user credentials.
43+
user_name: github-actions[bot]
44+
user_email: 41898282+github-actions[bot]@users.noreply.github.com

.github/workflows/release.yml

+42-45
Original file line numberDiff line numberDiff line change
@@ -14,31 +14,14 @@ jobs:
1414
- name: Checkout code
1515
uses: actions/checkout@v4
1616

17-
- uses: pnpm/action-setup@v4
18-
name: Install pnpm
19-
with:
20-
version: 9
21-
run_install: false
22-
23-
- name: Set up Node.js
24-
uses: actions/setup-node@v4
25-
with:
26-
node-version: 20
27-
cache: 'pnpm'
28-
29-
- name: Install dependencies
30-
run: pnpm install
31-
32-
# Inline install of semantic-release packages
33-
- name: Install semantic-release and plugins
34-
run: |
35-
pnpm add -D -w semantic-release @semantic-release/commit-analyzer @semantic-release/release-notes-generator @semantic-release/git @semantic-release/github @semantic-release/changelog
36-
3717
- name: Semantic Release
3818
uses: cycjimmy/semantic-release-action@v4
3919
id: get_version
4020
with:
4121
dry_run: true
22+
extra_plugins: |
23+
@semantic-release/[email protected]
24+
@semantic-release/git
4225
env:
4326
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4427

@@ -101,52 +84,66 @@ jobs:
10184
name: release-cli-${{ matrix.os }}
10285
path: apps/cli/release
10386

104-
checksum-and-release:
105-
needs: release
106-
runs-on: macos-latest
87+
sign:
88+
needs: build
89+
runs-on: ubuntu-latest
10790

10891
steps:
109-
- name: Checkout code
110-
uses: actions/checkout@v4
111-
112-
- uses: pnpm/action-setup@v4
113-
name: Install pnpm
92+
- name: Download artifacts
93+
uses: actions/download-artifact@v4
11494
with:
115-
version: 9
116-
run_install: false
95+
name: release-desktop-windows-latest
96+
path: release-desktop-windows-latest
11797

118-
- name: Set up Node.js
119-
uses: actions/setup-node@v4
98+
- name: Create directory for signed builds
99+
shell: bash
100+
run: mkdir release-desktop-windows-latest/signed-builds
101+
102+
- name: Sign build Windows exe
103+
uses: sslcom/actions-codesigner@develop
120104
with:
121-
node-version: 20
122-
cache: 'pnpm'
105+
command: sign
106+
username: ${{ secrets.SSL_USERNAME }}
107+
password: ${{ secrets.SSL_PASSWORD }}
108+
totp_secret: ${{ secrets.SSL_TOTP_SECRET }}
109+
file_path: release-desktop-windows-latest/sentry-client-windows.exe
110+
output_path: release-desktop-windows-latest/signed-builds
111+
112+
- name: Upload signed artifacts
113+
uses: actions/upload-artifact@v4
114+
with:
115+
name: release-signed-desktop-windows-latest
116+
path: release-desktop-windows-latest
123117

124-
- name: Install dependencies
125-
run: pnpm install
118+
checksum-and-release:
119+
needs: release
120+
runs-on: macos-latest
126121

127-
# Inline install of semantic-release packages
128-
- name: Install semantic-release and plugins
129-
run: |
130-
pnpm add -D -w semantic-release @semantic-release/commit-analyzer @semantic-release/release-notes-generator @semantic-release/git @semantic-release/github @semantic-release/changelog
122+
steps:
123+
- name: Checkout code
124+
uses: actions/checkout@v4
131125

132126
- name: Download artifacts
133127
uses: actions/download-artifact@v4
134128

135129
- name: Generate checksum
136130
run: |
137-
CHECKSUM=$(shasum -a 512 release-desktop-windows-latest/sentry-client-windows.exe | cut -f1 -d\ | xxd -r -p | base64)
131+
CHECKSUM=$(shasum -a 512 release-signed-desktop-windows-latest/signed-builds/sentry-client-windows.exe | cut -f1 -d\ | xxd -r -p | base64)
138132
CHECKSUM=$(echo "$CHECKSUM" | tr -d '\r\n')
139133
echo "SHA512 Checksum: $CHECKSUM"
140-
cat release-desktop-windows-latest/latest.yml
141-
sed -i '' -e "s#^sha512:.*#sha512: $CHECKSUM#" "release-desktop-windows-latest/latest.yml"
142-
sed -i '' -e "s#^ sha512:.*# sha512: $CHECKSUM#" "release-desktop-windows-latest/latest.yml"
134+
cat release-signed-desktop-windows-latest/latest.yml
135+
sed -i '' -e "s#^sha512:.*#sha512: $CHECKSUM#" "release-signed-desktop-windows-latest/latest.yml"
136+
sed -i '' -e "s#^ sha512:.*# sha512: $CHECKSUM#" "release-signed-desktop-windows-latest/latest.yml"
143137
144138
# Run semantic-release after the build is completed to publish the release
145139
- name: Semantic Release
146140
uses: cycjimmy/semantic-release-action@v4
147141
id: semantic
148142
with:
149143
dry_run: false
144+
extra_plugins: |
145+
@semantic-release/[email protected]
146+
@semantic-release/git
150147
env:
151148
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
152149

@@ -156,4 +153,4 @@ jobs:
156153
echo "New release version: ${{ steps.semantic.outputs.new_release_version }}"
157154
echo "Major: ${{ steps.semantic.outputs.new_release_major_version }}"
158155
echo "Minor: ${{ steps.semantic.outputs.new_release_minor_version }}"
159-
echo "Patch: ${{ steps.semantic.outputs.new_release_patch_version }}"
156+
echo "Patch: ${{ steps.semantic.outputs.new_release_patch_version }}"

.github/workflows/test-release.yml

+138
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
name: Pull Request
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- '**'
7+
8+
jobs:
9+
# Run semantic-release dry run before the matrix
10+
dryrun:
11+
runs-on: ubuntu-latest
12+
outputs:
13+
version: ${{ steps.get_version.outputs.new_release_version }} # Pass version to the next jobs
14+
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
19+
- name: Semantic Release
20+
uses: cycjimmy/semantic-release-action@v4
21+
id: get_version
22+
with:
23+
dry_run: true
24+
extra_plugins: |
25+
@semantic-release/[email protected]
26+
@semantic-release/git
27+
env:
28+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
29+
30+
# Matrix build jobs that depend on the dryrun job
31+
release:
32+
needs: dryrun
33+
strategy:
34+
matrix:
35+
os: [ubuntu-latest, macos-latest, windows-latest]
36+
runs-on: ${{ matrix.os }}
37+
env: # Pass the version as an environment variable to each matrix job
38+
VERSION: ${{ needs.dryrun.outputs.version }}
39+
40+
steps:
41+
- name: Checkout code
42+
uses: actions/checkout@v4
43+
44+
- uses: pnpm/action-setup@v4
45+
name: Install pnpm
46+
with:
47+
version: 9
48+
run_install: false
49+
50+
- name: Set up Node.js
51+
uses: actions/setup-node@v4
52+
with:
53+
node-version: 20
54+
cache: 'pnpm'
55+
56+
- name: Install dependencies
57+
run: pnpm install
58+
59+
# Use the version generated from dry-run in the build process
60+
- name: Set desktop app package version
61+
run: pnpm pkg set version=${{ env.VERSION }} --prefix apps/sentry-client-desktop
62+
63+
- name: Set CLI version
64+
run: sed -i'' -e 's/VERSION_NUMBER/${{ env.VERSION }}/g' packages/core/src/utils/version.ts
65+
66+
- name: Build monorepo
67+
run: npx nx run-many --target=build --all
68+
69+
- name: Upload sentry-client-desktop artifacts
70+
uses: actions/upload-artifact@v4
71+
with:
72+
name: release-desktop-${{ matrix.os }}
73+
path: apps/sentry-client-desktop/release
74+
75+
- name: Zip CLI artifacts
76+
run: |
77+
cd apps/cli/release
78+
zip sentry-node-cli-macos.zip sentry-node-cli-macos
79+
zip sentry-node-cli-linux.zip sentry-node-cli-linux
80+
zip sentry-node-cli-windows.zip sentry-node-cli-win.exe
81+
if: matrix.os == 'ubuntu-latest'
82+
83+
- name: Upload CLI artifacts
84+
uses: actions/upload-artifact@v4
85+
with:
86+
name: release-cli-${{ matrix.os }}
87+
path: apps/cli/release
88+
89+
sign:
90+
needs: build
91+
runs-on: ubuntu-latest
92+
93+
steps:
94+
- name: Download artifacts
95+
uses: actions/download-artifact@v4
96+
with:
97+
name: release-desktop-windows-latest
98+
path: release-desktop-windows-latest
99+
100+
- name: Create directory for signed builds
101+
shell: bash
102+
run: mkdir release-desktop-windows-latest/signed-builds
103+
104+
- name: Sign build Windows exe
105+
uses: sslcom/actions-codesigner@develop
106+
with:
107+
command: sign
108+
username: ${{ secrets.SSL_USERNAME }}
109+
password: ${{ secrets.SSL_PASSWORD }}
110+
totp_secret: ${{ secrets.SSL_TOTP_SECRET }}
111+
file_path: release-desktop-windows-latest/sentry-client-windows.exe
112+
output_path: release-desktop-windows-latest/signed-builds
113+
114+
- name: Upload signed artifacts
115+
uses: actions/upload-artifact@v4
116+
with:
117+
name: release-signed-desktop-windows-latest
118+
path: release-desktop-windows-latest
119+
120+
checksum-and-release:
121+
needs: release
122+
runs-on: macos-latest
123+
124+
steps:
125+
- name: Checkout code
126+
uses: actions/checkout@v4
127+
128+
- name: Download artifacts
129+
uses: actions/download-artifact@v4
130+
131+
- name: Generate checksum
132+
run: |
133+
CHECKSUM=$(shasum -a 512 release-signed-desktop-windows-latest/signed-builds/sentry-client-windows.exe | cut -f1 -d\ | xxd -r -p | base64)
134+
CHECKSUM=$(echo "$CHECKSUM" | tr -d '\r\n')
135+
echo "SHA512 Checksum: $CHECKSUM"
136+
cat release-signed-desktop-windows-latest/latest.yml
137+
sed -i '' -e "s#^sha512:.*#sha512: $CHECKSUM#" "release-signed-desktop-windows-latest/latest.yml"
138+
sed -i '' -e "s#^ sha512:.*# sha512: $CHECKSUM#" "release-signed-desktop-windows-latest/latest.yml"

release.config.js

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
module.exports = {
2+
branches: [
3+
"master",
4+
{ name: "develop", prerelease: true }
5+
],
6+
tagFormat: "${version}",
7+
plugins: [
8+
[
9+
'@semantic-release/commit-analyzer',
10+
{
11+
preset: 'angular',
12+
},
13+
],
14+
[
15+
"@semantic-release/release-notes-generator",
16+
{
17+
preset: 'angular',
18+
writerOpts: {
19+
finalizeContext (context) {
20+
const scopesToInclude = ['cli', 'desktop', 'operator'];
21+
22+
for (const commitGroup of context.commitGroups) {
23+
const filteredCommits = []
24+
25+
for (const commit of commitGroup.commits) {
26+
if (commit.scope && commit.scope.split(',').some(scope => scopesToInclude.includes(scope))) {
27+
filteredCommits.push(commit)
28+
}
29+
}
30+
31+
commitGroup.commits = filteredCommits
32+
}
33+
34+
return context
35+
},
36+
},
37+
},
38+
],
39+
"@semantic-release/changelog",
40+
[
41+
'@semantic-release/github',
42+
{
43+
assets: [
44+
{ path: "CHANGELOG.md", label: "Changelog" },
45+
{ path: "release-desktop-macos-latest/latest-mac.yml", label: "macOS Latest YML" },
46+
{ path: "release-desktop-macos-latest/sentry-client-macos.dmg.blockmap", label: "macOS Blockmap" },
47+
{ path: "release-desktop-macos-latest/sentry-client-macos.dmg", label: "macOS DMG" },
48+
{ path: "release-desktop-ubuntu-latest/latest-linux.yml", label: "Linux Latest YML" },
49+
{ path: "release-desktop-ubuntu-latest/sentry-client-linux.AppImage", label: "Linux AppImage" },
50+
{ path: "release-signed-desktop-windows-latest/latest.yml", label: "Windows Latest YML" },
51+
{ path: "release-signed-desktop-windows-latest/sentry-client-windows.exe.blockmap", label: "Windows Blockmap" },
52+
{ path: "release-signed-desktop-windows-latest/signed-builds/sentry-client-windows.exe", label: "Windows EXE" },
53+
{ path: "release-cli-ubuntu-latest/sentry-node-cli-macos.zip", label: "CLI macOS ZIP" },
54+
{ path: "release-cli-ubuntu-latest/sentry-node-cli-linux.zip", label: "CLI Linux ZIP" },
55+
{ path: "release-cli-ubuntu-latest/sentry-node-cli-windows.zip", label: "CLI Windows ZIP" },
56+
],
57+
},
58+
],
59+
"@semantic-release/git",
60+
],
61+
};

0 commit comments

Comments
 (0)