-
Notifications
You must be signed in to change notification settings - Fork 25
53 lines (49 loc) · 1.71 KB
/
release.yml
File metadata and controls
53 lines (49 loc) · 1.71 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
name: Release For New Electron Version
on:
workflow_dispatch:
inputs:
version:
description: Electron version to use with "v" prefix (e.g. v30.0.0)
required: true
permissions: {}
jobs:
test:
permissions:
contents: read
uses: ./.github/workflows/test.yml
with:
electron-version: ${{ github.event.inputs.version }}
release:
runs-on: ubuntu-latest
environment: npm-trusted-publisher
needs: test
permissions:
id-token: write # for publishing releases
env:
VERSION: ${{ github.event.inputs.version }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Setup Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: "20.17.0"
package-manager-cache: false
- name: Update npm to version that supports trusted publishing
run: npm install -g npm@^11.5.1
- name: Update Version
run: node script/update-version.js ${VERSION}
- name: Confirm Version Updated
run: node -e "if (require('./package.json').version === '0.0.0-development') process.exit(1)"
- name: Install Dependencies
run: yarn install --immutable
- name: Get GitHub app token
id: secret-service
uses: electron/secret-service-action@3476425e8b30555aac15b1b7096938e254b0e155 # v1.0.0
- name: Create Release
env:
GITHUB_TOKEN: ${{ fromJSON(steps.secret-service.outputs.secrets).GITHUB_TOKEN }}
run: gh release create ${VERSION} -t ${VERSION}
- name: Publish to npm
run: npm publish --tag latest