Skip to content

Commit 6f34f9a

Browse files
erickzhaogeorgexu99VerteDindeDavid Sanders
authored
ci: set up npm trusted publishing (#4070)
Co-authored-by: George Xu <georgexu99@users.noreply.github.com> Co-authored-by: Keeley Hammond <VerteDinde@users.noreply.github.com> Co-authored-by: David Sanders <dasanders+microsoft@microsoft.com>
1 parent 55ff3e3 commit 6f34f9a

45 files changed

Lines changed: 110 additions & 43 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ on:
99
pull_request:
1010
merge_group:
1111
types: [checks_requested]
12+
workflow_call:
1213

1314
env:
1415
NODE_VERSION: 20.17.0

.github/workflows/release.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: Release (Forge 8)
2+
3+
on:
4+
workflow_dispatch:
5+
6+
# Ensure only one release workflow runs at a time
7+
concurrency:
8+
group: release
9+
cancel-in-progress: false
10+
11+
jobs:
12+
test:
13+
uses: ./.github/workflows/ci.yml
14+
15+
release:
16+
name: Publish Next Release
17+
environment: npm-trusted-publisher
18+
runs-on: ubuntu-latest
19+
needs: test
20+
# Run this in the `next` branch only
21+
if: github.repository == 'electron/forge' && github.ref == 'refs/heads/next'
22+
permissions:
23+
contents: write
24+
id-token: write # Required for trusted publishing
25+
steps:
26+
- name: Checkout
27+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8
28+
with:
29+
# We need the full history for version calculation
30+
fetch-depth: 0
31+
32+
- name: Install Node.js
33+
uses: actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.0.1
34+
with:
35+
node-version-file: '.nvmrc'
36+
package-manager-cache: false
37+
38+
- name: Install dependencies
39+
run: yarn install --immutable
40+
41+
- name: Build Electron Forge
42+
run: yarn build
43+
44+
- name: Cache ESLint
45+
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
46+
with:
47+
path: .eslintcache
48+
key: v2-lint-dependencies-${{ hashFiles('yarn.lock') }}-${{ hashFiles('.eslintrc.json') }}
49+
50+
- name: Lint codebase
51+
run: |
52+
yarn lint
53+
54+
- name: Upload build artifacts
55+
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
56+
with:
57+
name: dist-files
58+
path: packages/*/*/dist/*
59+
60+
- name: Get GitHub app token
61+
id: secret-service
62+
uses: electron/secret-service-action@3476425e8b30555aac15b1b7096938e254b0e155 # v1.0.0
63+
64+
- name: Publish prerelease (using OIDC trusted publishing)
65+
env:
66+
GH_TOKEN: ${{ fromJSON(steps.secret-service.outputs.secrets).GITHUB_TOKEN }}
67+
run: lerna publish prerelease --force-publish --preid=alpha --pre-dist-tag=alpha --no-changelog --exact

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20.19.0
1+
22

lerna.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
3-
"version": "7.10.2",
3+
"version": "8.0.0-alpha.0",
44
"npmClient": "yarn"
55
}

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
"build": "tsc -b packages && ts-node tools/test-dist",
1212
"build:watch": "tsc -b packages --watch",
1313
"docs": "yarn build && typedoc",
14-
"lerna:publish": "lerna publish --force-publish --conventional-commits --no-changelog --exact",
1514
"lint:js": "prettier --check . --experimental-cli && eslint . --cache",
1615
"lint:markdown": "electron-markdownlint \"**/*.md\"",
1716
"lint:markdown-js": "electron-lint-markdown-standard --root . --ignore-path .markdownlintignore --semi \"**/*.md\"",

packages/api/cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@electron-forge/cli",
3-
"version": "7.10.2",
3+
"version": "8.0.0-alpha.0",
44
"description": "A complete tool for building modern Electron applications",
55
"repository": "https://github.com/electron/forge",
66
"author": "Samuel Attard",

packages/api/core/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@electron-forge/core",
3-
"version": "7.10.2",
3+
"version": "8.0.0-alpha.0",
44
"description": "A complete tool for building modern Electron applications",
55
"repository": "https://github.com/electron/forge",
66
"main": "dist/api/index.js",

packages/external/create-electron-app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "create-electron-app",
3-
"version": "7.10.2",
3+
"version": "8.0.0-alpha.0",
44
"description": "Create Electron App",
55
"main": "dist/index.js",
66
"typings": "dist/index.d.ts",

packages/maker/appx/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@electron-forge/maker-appx",
3-
"version": "7.10.2",
3+
"version": "8.0.0-alpha.0",
44
"description": "AppX maker for Electron Forge",
55
"repository": "https://github.com/electron/forge",
66
"author": "Samuel Attard",

packages/maker/base/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@electron-forge/maker-base",
3-
"version": "7.10.2",
3+
"version": "8.0.0-alpha.0",
44
"description": "Base maker for Electron Forge",
55
"repository": "https://github.com/electron/forge",
66
"author": "Samuel Attard",

0 commit comments

Comments
 (0)