Skip to content

Commit 007c01f

Browse files
authored
added support for npm prereleases (#2959)
### Fixes # <!-- Mention the issues this PR addresses --> ### Checks - [ ] Ran `yarn test-build` - [ ] Updated relevant documentations - [ ] Updated matching config options in altair-static ### Changes proposed in this pull request: <!-- Describe the changes being introduced in this PR --> ## Summary by Sourcery Add support for publishing prerelease npm packages from non-production workflows and document macOS code signing setup for releases. CI: - Extend reusable npm publish workflow to optionally publish prerelease packages with branch-based tags and invoke it from the PR master workflow in non-production mode. Documentation: - Document macOS code signing requirements and steps for exporting certificates for use in CI/CD pipelines. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Chores** * Added a production toggle with conditional publish vs. prerelease flow and updated publish permissions. * Introduced a central main CI workflow and removed multiple legacy workflows. * Pinned many CI actions, standardized credential handling, and exposed explicit per-workflow secrets. * Tightened workspace release/dependency policies and added a Dependabot cooldown. * **Documentation** * Expanded macOS app signing guidance and added Angular migration steps (signing content duplicated). <sub>✏️ Tip: You can customize this high-level summary in your review settings.</sub> <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent 4aa5679 commit 007c01f

19 files changed

+500
-383
lines changed

.github/dependabot.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,5 @@ updates:
99
directory: "/" # Location of package manifests
1010
schedule:
1111
interval: "weekly"
12+
cooldown:
13+
default-days: 7

.github/workflows/__deploy-pages.yml

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@ on:
2121
required: false
2222
type: string
2323
default: "22"
24+
secrets:
25+
cloudflare_api_token:
26+
description: "Cloudflare API token"
27+
required: true
28+
cloudflare_account_id:
29+
description: "Cloudflare Account ID"
30+
required: true
2431
workflow_dispatch:
2532
inputs:
2633
project_name:
@@ -42,41 +49,45 @@ on:
4249
type: string
4350
default: "22"
4451

52+
permissions: {}
53+
4554
jobs:
4655
deploy:
4756
name: ${{ inputs.deployment_name }}
4857
runs-on: ubuntu-latest
4958
steps:
50-
- uses: actions/checkout@v4
59+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
60+
with:
61+
persist-credentials: false
5162

52-
- uses: pnpm/action-setup@v4
63+
- uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0
5364

5465
- name: Use Node.js
55-
uses: actions/setup-node@v4
66+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
5667
with:
5768
node-version: ${{ inputs.node_version }}
5869
cache: "pnpm"
5970

6071
- name: Install dependencies
6172
run: pnpm i --frozen-lockfile
6273
env:
63-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
74+
GITHUB_TOKEN: ${{ secrets.github_token }}
6475
NODE_OPTIONS: "--max_old_space_size=4096"
6576

6677
- name: Bootstrap monorepo
6778
run: pnpm bootstrap
6879
env:
69-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
80+
GITHUB_TOKEN: ${{ secrets.github_token }}
7081
NODE_OPTIONS: "--max_old_space_size=4096"
7182

7283
- name: Deploy to Cloudflare Pages
7384
id: deploy
74-
uses: cloudflare/wrangler-action@v3
85+
uses: cloudflare/wrangler-action@da0e0dfe58b7a431659754fdf3f186c529afbe65 # v3.14.1
7586
with:
76-
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
77-
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
87+
apiToken: ${{ secrets.cloudflare_api_token }}
88+
accountId: ${{ secrets.cloudflare_account_id }}
7889
command: pages publish "${{ inputs.dist_path }}" --project-name="${{ inputs.project_name }}"
79-
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
90+
gitHubToken: ${{ secrets.github_token }}
8091

8192
- name: Output deployment URL
8293
run: |

.github/workflows/_deploy-sites.yml

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,13 @@ on:
3232
required: false
3333
default: true
3434
type: boolean
35+
secrets:
36+
cloudflare_api_token:
37+
description: "Cloudflare API token"
38+
required: true
39+
cloudflare_account_id:
40+
description: "Cloudflare Account ID"
41+
required: true
3542
workflow_dispatch:
3643
inputs:
3744
node_version:
@@ -64,6 +71,8 @@ on:
6471
default: true
6572
type: boolean
6673

74+
permissions: {}
75+
6776
jobs:
6877
delay:
6978
name: Delay before deployment
@@ -87,7 +96,9 @@ jobs:
8796
dist_path: "packages/altair-app/dist/browser"
8897
deployment_name: "Deploy Web App"
8998
node_version: ${{ inputs.node_version }}
90-
secrets: inherit
99+
secrets:
100+
cloudflare_api_token: ${{ secrets.cloudflare_api_token }}
101+
cloudflare_account_id: ${{ secrets.cloudflare_account_id }}
91102

92103
deploy-docs:
93104
name: Deploy Docs
@@ -99,7 +110,9 @@ jobs:
99110
dist_path: "packages/altair-docs/.vitepress/dist"
100111
deployment_name: "Deploy Documentation"
101112
node_version: ${{ inputs.node_version }}
102-
secrets: inherit
113+
secrets:
114+
cloudflare_api_token: ${{ secrets.cloudflare_api_token }}
115+
cloudflare_account_id: ${{ secrets.cloudflare_account_id }}
103116

104117
deploy-redirect:
105118
name: Deploy Login Redirect
@@ -111,7 +124,9 @@ jobs:
111124
dist_path: "packages/login-redirect/dist"
112125
deployment_name: "Deploy Login Redirect"
113126
node_version: ${{ inputs.node_version }}
114-
secrets: inherit
127+
secrets:
128+
cloudflare_api_token: ${{ secrets.cloudflare_api_token }}
129+
cloudflare_account_id: ${{ secrets.cloudflare_account_id }}
115130

116131
deploy-sandbox:
117132
name: Deploy Sandbox
@@ -123,4 +138,6 @@ jobs:
123138
dist_path: "packages/altair-iframe-sandbox/dist"
124139
deployment_name: "Deploy Iframe Sandbox"
125140
node_version: ${{ inputs.node_version }}
126-
secrets: inherit
141+
secrets:
142+
cloudflare_api_token: ${{ secrets.cloudflare_api_token }}
143+
cloudflare_account_id: ${{ secrets.cloudflare_account_id }}

.github/workflows/_publish-electron.yml

Lines changed: 83 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -4,51 +4,90 @@ on:
44
workflow_call:
55
inputs:
66
node_version:
7-
description: 'Node.js version to use'
8-
default: '22'
7+
description: "Node.js version to use"
8+
default: "22"
99
type: string
1010
build:
11-
description: 'Whether to build'
11+
description: "Whether to build"
1212
required: false
1313
default: true
1414
type: boolean
1515
publish:
16-
description: 'Whether to publish'
16+
description: "Whether to publish"
1717
required: false
1818
default: true
1919
type: boolean
2020
publish_chocolatey:
21-
description: 'Whether to publish to Chocolatey'
21+
description: "Whether to publish to Chocolatey"
2222
required: false
2323
default: true
2424
type: boolean
25+
secrets:
26+
apple_api_key:
27+
description: "Apple API key for macOS notarization"
28+
required: true
29+
apple_api_key_id:
30+
description: "Apple API key ID for macOS notarization"
31+
required: true
32+
apple_id:
33+
description: "Apple ID for macOS notarization"
34+
required: true
35+
apple_id_password:
36+
description: "Apple ID password for macOS notarization"
37+
required: true
38+
apple_team_id:
39+
description: "Apple Team ID for macOS notarization"
40+
required: true
41+
chocolatey_api_key:
42+
description: "Chocolatey API key for publishing"
43+
required: true
44+
mac_certs:
45+
description: "macOS code signing certificates (base64 encoded)"
46+
required: true
47+
mac_certs_password:
48+
description: "Password for macOS code signing certificates"
49+
required: true
50+
sentry_auth_token:
51+
description: "Sentry auth token for uploading source maps"
52+
required: true
53+
sentry_org:
54+
description: "Sentry organization"
55+
required: true
56+
sentry_project:
57+
description: "Sentry project"
58+
required: true
59+
snapcraft_store_credentials:
60+
description: "Snapcraft store credentials for Snap Store publishing"
61+
required: true
2562
outputs:
2663
# Map the workflow output(s) to job output(s)
2764
version:
28-
description: 'Built/published version from the workflow'
65+
description: "Built/published version from the workflow"
2966
value: ${{ jobs.electron.outputs.version }}
3067
workflow_dispatch:
3168
inputs:
3269
node_version:
33-
description: 'Node.js version to use'
34-
default: '22'
70+
description: "Node.js version to use"
71+
default: "22"
3572
type: string
3673
build:
37-
description: 'Whether to build'
74+
description: "Whether to build"
3875
required: false
3976
default: true
4077
type: boolean
4178
publish:
42-
description: 'Whether to publish'
79+
description: "Whether to publish"
4380
required: false
4481
default: true
4582
type: boolean
4683
publish_chocolatey:
47-
description: 'Whether to publish to Chocolatey'
84+
description: "Whether to publish to Chocolatey"
4885
required: false
4986
default: true
5087
type: boolean
5188

89+
permissions: {}
90+
5291
jobs:
5392
electron:
5493
strategy:
@@ -59,26 +98,28 @@ jobs:
5998
outputs:
6099
version: ${{ steps.getversion.outputs.version }}
61100
steps:
62-
- uses: actions/checkout@v4
63-
- uses: pnpm/action-setup@v4
101+
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
102+
with:
103+
persist-credentials: false
104+
- uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061 # v4.2.0
64105
- name: Use Node.js ${{ inputs.node_version }} on ${{ matrix.os }}
65-
uses: actions/setup-node@v4
106+
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
66107
with:
67108
node-version: ${{ inputs.node_version }}
68-
cache: 'pnpm'
69-
- uses: maxim-lobanov/setup-xcode@v1
109+
cache: "pnpm"
110+
- uses: maxim-lobanov/setup-xcode@60606e260d2fc5762a71e64e74b2174e8ea3c8bd # v1.6.0
70111
if: startsWith(matrix.os, 'macos')
71112
with:
72113
xcode-version: latest-stable
73114
- run: pnpm i --frozen-lockfile
74-
- uses: nick-invision/retry@v2
115+
- uses: nick-invision/retry@14672906e672a08bd6eeb15720e9ed3ce869cdd4 # v2.9.0
75116
with:
76117
timeout_minutes: 20
77118
max_attempts: 3
78119
command: pnpm build:ci
79120
# Update .npmrc file to support electron builder
80121
# https://www.electron.build/#note-for-pnpm
81-
- uses: nodef/npm-config.action@v1.0.0
122+
- uses: nodef/npm-config.action@d886ec78e341a72863181caf1c2d3c10b6a776d2 # v1.0.0
82123
with:
83124
path: .npmrc # Path to the .npmrc file
84125
reset: false
@@ -90,10 +131,10 @@ jobs:
90131
- run: pnpm deploy --filter=altair out/elx-files
91132

92133
- name: Install Snapcraft
93-
uses: samuelmeuli/action-snapcraft@v2
134+
uses: samuelmeuli/action-snapcraft@d33c176a9b784876d966f80fb1b461808edc0641 # v2.1.1
94135
if: startsWith(matrix.os, 'ubuntu')
95136
env:
96-
SNAPCRAFT_TOKEN: ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }}
137+
SNAPCRAFT_TOKEN: ${{ secrets.snapcraft_store_credentials }}
97138

98139
- name: Prepare for app notarization
99140
if: startsWith(matrix.os, 'macos')
@@ -122,7 +163,7 @@ jobs:
122163
# disable for macos not in master branch, because code signing is skipped in pull requests
123164
if: ${{ inputs.publish || !(startsWith(matrix.os, 'macos') && github.ref != 'refs/heads/master') }}
124165
id: build-electron
125-
uses: paneron/action-electron-builder@v1.8.1
166+
uses: paneron/action-electron-builder@14b133702d1b2e9749912051c43ed62b4afe56c8 # v1.8.1
126167
with:
127168
github_token: ${{ secrets.github_token }}
128169
package_root: out/elx-files/
@@ -136,12 +177,12 @@ jobs:
136177
env:
137178
# macOS notarization API key
138179
# https://www.codiga.io/blog/notarize-sign-electron-app/
139-
APPLE_ID: ${{ secrets.APPLE_ID }}
140-
APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }}
141-
APPLEIDPASS: ${{ secrets.APPLE_ID_PASSWORD }}
142-
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
143-
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_STORE_CREDENTIALS }}
144-
DEBUG: '@malept/flatpak-bundler'
180+
APPLE_ID: ${{ secrets.apple_id }}
181+
APPLE_ID_PASSWORD: ${{ secrets.apple_id_password }}
182+
APPLEIDPASS: ${{ secrets.apple_id_password }}
183+
APPLE_TEAM_ID: ${{ secrets.apple_team_id }}
184+
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.snapcraft_store_credentials }}
185+
DEBUG: "@malept/flatpak-bundler"
145186

146187
# chocolatey
147188
- name: Read VERSION file
@@ -154,11 +195,11 @@ jobs:
154195
echo "version=$(cat VERSION)" >> $GITHUB_OUTPUT
155196
- name: Add mask
156197
run: |
157-
echo "::add-mask::${{ secrets.CHOCOLATEY_API_KEY }}"
198+
echo "::add-mask::${{ secrets.chocolatey_api_key }}"
158199
- name: chocolatey pack
159200
if: startsWith(matrix.os, 'windows')
160201
continue-on-error: true
161-
uses: crazy-max/ghaction-chocolatey@v3
202+
uses: crazy-max/ghaction-chocolatey@2526f467ccbd337d307fe179959cabbeca0bc8c0 # v3.4.0
162203
with:
163204
args: pack chocolatey\altair-graphql.nuspec
164205
# - name: chocolatey install (test choco packaging)
@@ -172,39 +213,39 @@ jobs:
172213
- name: chocolatey push
173214
if: ${{ startsWith(matrix.os, 'windows') && inputs.publish_chocolatey && inputs.publish }}
174215
continue-on-error: true
175-
uses: crazy-max/ghaction-chocolatey@v3
216+
uses: crazy-max/ghaction-chocolatey@2526f467ccbd337d307fe179959cabbeca0bc8c0 # v3.4.0
176217
with:
177-
args: push altair-graphql.${{ steps.getversion.outputs.version }}.nupkg -s https://push.chocolatey.org/ -k="'${{ secrets.CHOCOLATEY_API_KEY }}'"
218+
args: push altair-graphql.${{ steps.getversion.outputs.version }}.nupkg -s https://push.chocolatey.org/ -k="'${{ secrets.chocolatey_api_key }}'"
178219

179220
- name: Upload source maps to Sentry (app)
180221
if: startsWith(matrix.os, 'ubuntu') && env.SENTRY_ORG
181-
uses: getsentry/action-release@v1
222+
uses: getsentry/action-release@a74facf8a080ecbdf1cb355f16743530d712abb7 # v1.11.0
182223
env:
183-
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
184-
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
185-
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
224+
SENTRY_AUTH_TOKEN: ${{ secrets.sentry_auth_token }}
225+
SENTRY_ORG: ${{ secrets.sentry_org }}
226+
SENTRY_PROJECT: ${{ secrets.sentry_project }}
186227
with:
187228
environment: ${{ inputs.publish && 'production' || '' }}
188229
sourcemaps: packages/altair-app/dist/
189230
version: ${{ inputs.publish && steps.getversion.outputs.version || '' }}
190-
url_prefix: 'altair://-'
231+
url_prefix: "altair://-"
191232
finalize: false
192233
- name: Upload source maps to Sentry (electron)
193234
if: startsWith(matrix.os, 'ubuntu') && env.SENTRY_ORG
194-
uses: getsentry/action-release@v1
235+
uses: getsentry/action-release@a74facf8a080ecbdf1cb355f16743530d712abb7 # v1.11.0
195236
env:
196-
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
197-
SENTRY_ORG: ${{ secrets.SENTRY_ORG }}
198-
SENTRY_PROJECT: ${{ secrets.SENTRY_PROJECT }}
237+
SENTRY_AUTH_TOKEN: ${{ secrets.sentry_auth_token }}
238+
SENTRY_ORG: ${{ secrets.sentry_org }}
239+
SENTRY_PROJECT: ${{ secrets.sentry_project }}
199240
with:
200241
environment: ${{ inputs.publish && 'production' || '' }}
201242
sourcemaps: out/elx-files/dist/
202243
version: ${{ inputs.publish && steps.getversion.outputs.version || '' }}
203-
url_prefix: 'app:///dist'
244+
url_prefix: "app:///dist"
204245

205246
- name: Upload electron builds
206247
if: always()
207-
uses: actions/upload-artifact@v4
248+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
208249
with:
209250
name: electron-builds-${{ matrix.os }}
210251
path: out/elx-files/out/**

0 commit comments

Comments
 (0)