Release For New Electron Version #382
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | |
| jobs: | |
| test: | |
| 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@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.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 |