Workflow file for this run
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 builds to GitHub Releases | |
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| permissions: | |
| contents: write | |
| jobs: | |
| release: | |
| name: Release builds to GitHub Releases | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: pnpm/action-setup@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: 22 | |
| cache: pnpm | |
| - name: Install dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Build moonlight | |
| env: | |
| NODE_ENV: production | |
| MOONLIGHT_BRANCH: stable | |
| MOONLIGHT_VERSION: ${{ github.ref_name }} | |
| run: pnpm run build | |
| - name: Build moonlight (mv3) | |
| env: | |
| NODE_ENV: production | |
| MOONLIGHT_BRANCH: stable | |
| MOONLIGHT_VERSION: ${{ github.ref_name }} | |
| run: pnpm run browser | |
| - name: Build moonlight (mv2) | |
| env: | |
| NODE_ENV: production | |
| MOONLIGHT_BRANCH: stable | |
| MOONLIGHT_VERSION: ${{ github.ref_name }} | |
| run: pnpm run browser-mv2 | |
| - name: Separate browser builds | |
| run: | | |
| mv ./dist/browser ./browser | |
| mv ./dist/browser-mv2 ./browser-mv2 | |
| - name: Copy browser's index.js to browser.js | |
| run: | | |
| cp ./browser/index.js ./browser.js | |
| - name: Create archives | |
| run: | | |
| cd ./dist | |
| tar -czf ../dist.tar.gz * | |
| cd ../browser | |
| tar -czf ../browser.tar.gz * | |
| cd ../browser-mv2 | |
| tar -czf ../browser-mv2.tar.gz * | |
| cd .. | |
| - name: Deploy to GitHub | |
| uses: ncipollo/release-action@v1 | |
| with: | |
| artifacts: "dist.tar.gz,browser.tar.gz,browser-mv2.tar.gz,browser.js" | |
| bodyFile: ./CHANGELOG.md |