|
| 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 |
0 commit comments