| name: release | |
| on: | |
| workflow_dispatch: {} | |
| schedule: | |
| - cron: '50 5 * * 2-6' # 05:50 UTC, Tue-Sat morning (21:50 PST / 22:50 PDT Mon-Fri night) | |
| permissions: | |
| contents: read | |
| jobs: | |
| build-wasm: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| outputs: | |
| PKG_VERSION: ${{ steps.build.outputs.PKG_VERSION }} | |
| steps: | |
| - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6 | |
| with: | |
| persist-credentials: false | |
| - name: Build Emscripten Package | |
| id: build | |
| run: | | |
| GITHUB_REPOSITORY="${{ github.repository }}" GITHUB_REF_NAME="${GITHUB_REF_NAME}" .github/workflows/package-emdawnwebgpu.sh | |
| - name: Upload WASM Artifacts | |
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 | |
| with: | |
| name: emdawnwebgpu | |
| path: | | |
| ${{ steps.build.outputs.REMOTE_PORT_FILE }} | |
| ${{ steps.build.outputs.PKG_FILE }} | |
| RELEASE_INFO.md | |
| build-native: | |
| uses: ./.github/workflows/ci.yml | |
| publish: | |
| needs: [build-wasm, build-native] | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Download All Artifacts | |
| uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4 | |
| with: | |
| path: artifacts | |
| - name: Display Downloaded Files | |
| run: | | |
| mv artifacts/emdawnwebgpu/RELEASE_INFO.md . | |
| ls -R artifacts | |
| - name: Upload to GitHub Release | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| TAG_NAME: ${{ needs.build-wasm.outputs.PKG_VERSION }} | |
| run: | | |
| gh release create "$TAG_NAME" \ | |
| --title "$TAG_NAME" \ | |
| --repo ${{ github.repository }} \ | |
| --notes-file RELEASE_INFO.md \ | |
| artifacts/Dawn-*/Dawn-*.tar.gz \ | |
| artifacts/dawn-android-*/dawn-android-*.tar.gz \ | |
| artifacts/dawn-apple-*/dawn-apple-*.xcframework.tar.gz \ | |
| artifacts/dawn-headers-*/dawn-headers-*.tar.gz \ | |
| artifacts/emdawnwebgpu/* | |
| alert-on-failure: | |
| needs: publish | |
| runs-on: ubuntu-latest | |
| if: ${{ failure() }} | |
| steps: | |
| - name: Alert on failure | |
| run: | | |
| curl -X POST \ | |
| -H 'Content-Type: application/json; charset=UTF-8' \ | |
| -d '{"text": "Release failed: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"}' \ | |
| '${{secrets.GARDENING_CHAT_WEBHOOK_URL}}' |