Merge pull request #1 from Paca-AI/cicd/initialize-cicd #2
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: Build and Release Plugin Assets | |
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| build-and-release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: "1.24" | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - name: Build backend WASM | |
| working-directory: backend | |
| run: | | |
| set -euo pipefail | |
| mkdir -p ../release/backend | |
| GOOS=wasip1 GOARCH=wasm go build -buildmode=c-shared -o ../release/backend/webhook.wasm . | |
| - name: Build frontend | |
| working-directory: frontend | |
| run: | | |
| set -euo pipefail | |
| bun install --frozen-lockfile | |
| bun run build | |
| - name: Collect release files | |
| run: | | |
| set -euo pipefail | |
| mkdir -p release/frontend | |
| cp -R frontend/dist release/frontend/dist | |
| mkdir -p release/migrations | |
| cp -R backend/migrations/. release/migrations/ | |
| cp plugin.json release/plugin.json | |
| - name: Create archives | |
| run: | | |
| set -euo pipefail | |
| tar -czf webhook-backend-wasm.tar.gz -C release/backend webhook.wasm | |
| tar -czf webhook-frontend-dist.tar.gz -C release/frontend dist | |
| tar -czf webhook-migrations.tar.gz -C release migrations | |
| tar -czf webhook-plugin-manifest.tar.gz -C release plugin.json | |
| - name: Generate checksums | |
| run: | | |
| set -euo pipefail | |
| sha256sum webhook-backend-wasm.tar.gz \ | |
| webhook-frontend-dist.tar.gz \ | |
| webhook-migrations.tar.gz \ | |
| webhook-plugin-manifest.tar.gz > checksums.txt | |
| - name: Publish GitHub Release assets | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| generate_release_notes: true | |
| files: | | |
| webhook-backend-wasm.tar.gz | |
| webhook-frontend-dist.tar.gz | |
| webhook-migrations.tar.gz | |
| webhook-plugin-manifest.tar.gz | |
| checksums.txt |