|
| 1 | +name: Release |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + tags: |
| 6 | + - "v*" |
| 7 | + |
| 8 | +permissions: |
| 9 | + contents: write |
| 10 | + |
| 11 | +jobs: |
| 12 | + build: |
| 13 | + name: Build · ${{ matrix.name }} |
| 14 | + strategy: |
| 15 | + fail-fast: false |
| 16 | + matrix: |
| 17 | + include: |
| 18 | + - name: macOS |
| 19 | + os: macos-latest |
| 20 | + artifact: macos |
| 21 | + - name: Windows |
| 22 | + os: windows-latest |
| 23 | + artifact: windows |
| 24 | + runs-on: ${{ matrix.os }} |
| 25 | + steps: |
| 26 | + - name: Checkout |
| 27 | + uses: actions/checkout@v7 |
| 28 | + - name: Set up Node.js |
| 29 | + uses: actions/setup-node@v7 |
| 30 | + with: |
| 31 | + node-version: 22 |
| 32 | + cache: npm |
| 33 | + - name: Install dependencies |
| 34 | + run: npm ci |
| 35 | + - name: Lint and test |
| 36 | + run: npm run check |
| 37 | + - name: Build macOS Apple Silicon |
| 38 | + if: runner.os == 'macOS' |
| 39 | + run: npm run dist -- --mac --arm64 |
| 40 | + - name: Build macOS Intel |
| 41 | + if: runner.os == 'macOS' |
| 42 | + run: npm run dist -- --mac --x64 |
| 43 | + - name: Build Windows x64 |
| 44 | + if: runner.os == 'Windows' |
| 45 | + run: npm run dist -- --win --x64 |
| 46 | + - name: Upload packages |
| 47 | + uses: actions/upload-artifact@v7 |
| 48 | + with: |
| 49 | + name: release-${{ matrix.artifact }} |
| 50 | + path: | |
| 51 | + release/*.dmg |
| 52 | + release/*.zip |
| 53 | + release/*.exe |
| 54 | + if-no-files-found: error |
| 55 | + retention-days: 7 |
| 56 | + |
| 57 | + publish: |
| 58 | + name: Publish GitHub Release |
| 59 | + needs: build |
| 60 | + runs-on: ubuntu-latest |
| 61 | + steps: |
| 62 | + - name: Checkout release notes |
| 63 | + uses: actions/checkout@v7 |
| 64 | + - name: Download packages |
| 65 | + uses: actions/download-artifact@v8 |
| 66 | + with: |
| 67 | + path: artifacts |
| 68 | + merge-multiple: true |
| 69 | + - name: Generate checksums |
| 70 | + working-directory: artifacts |
| 71 | + run: sha256sum -- * > SHA256SUMS.txt |
| 72 | + - name: Create release |
| 73 | + env: |
| 74 | + GH_TOKEN: ${{ github.token }} |
| 75 | + run: gh release create "$GITHUB_REF_NAME" artifacts/* --repo "$GITHUB_REPOSITORY" --verify-tag --title "JLaunch $GITHUB_REF_NAME" --notes-file RELEASE_NOTES.md |
0 commit comments