Distro for Linux for WebAssembly
at main 72 lines 2.2 kB view raw
1on: 2 push: 3 branches: 4 - main 5 pull_request: 6 7jobs: 8 list: 9 runs-on: ubuntu-24.04 10 outputs: 11 matrix: ${{ steps.list.outputs.matrix }} 12 steps: 13 - uses: actions/checkout@v5 14 - uses: nixbuild/nix-quick-install-action@v34 15 - uses: cachix/cachix-action@v16 16 with: 17 name: linuxwasm 18 authToken: "${{secrets.CACHIX_AUTH_TOKEN}}" 19 - name: List packages 20 id: list 21 run: | 22 eval "$(nix print-dev-env .#ci)" 23 matrix="$(nix-eval-jobs --flake .#checks.x86_64-linux --check-cache-status | jq -sc ' 24 [ 25 .[] 26 | select(.isCached | not).attr 27 | select(test("-shell$") | not) 28 ] 29 | if length > 0 then . else ["pre-commit"] end 30 ')" 31 echo "matrix=$matrix" >> "$GITHUB_OUTPUT" 32 33 build: 34 needs: list 35 runs-on: ubuntu-24.04 36 strategy: 37 fail-fast: false 38 matrix: 39 pkg: ${{ fromJson(needs.list.outputs.matrix) }} 40 name: Build ${{ matrix.pkg }} 41 steps: 42 - uses: actions/checkout@v5 43 - uses: nixbuild/nix-quick-install-action@v34 44 - uses: cachix/cachix-action@v16 45 with: 46 name: linuxwasm 47 authToken: "${{secrets.CACHIX_AUTH_TOKEN}}" 48 - name: Build 49 run: | 50 eval "$(nix print-dev-env .#ci)" 51 nix build '.#checks.x86_64-linux.${{ matrix.pkg }}^*' 52 53 deploy: 54 needs: build 55 if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == 'tombl/distro' 56 runs-on: ubuntu-24.04 57 steps: 58 - uses: actions/checkout@v5 59 - uses: nixbuild/nix-quick-install-action@v34 60 - uses: cachix/cachix-action@v16 61 with: 62 name: linuxwasm 63 authToken: "${{secrets.CACHIX_AUTH_TOKEN}}" 64 - name: Build 65 run: | 66 eval "$(nix print-dev-env .#ci)" 67 nix build .#packages.x86_64-linux.site --print-build-logs 68 - uses: cloudflare/wrangler-action@v3 69 with: 70 apiToken: ${{secrets.CLOUDFLARE_API_TOKEN}} 71 accountId: 7d87194d9d4af2959fb81de343dd63d9 72 command: pages deploy result/ --project-name=linux