| @@ -4,49 +4,61 @@ on: |
| 4 | 4 | push: |
| 5 | 5 | tags: |
| 6 | 6 | - 'v*' |
| 7 | + workflow_dispatch: |
| 7 | 8 | |
| 8 | 9 | jobs: |
| 9 | 10 | npm: |
| 10 | | - name: npm |
| 11 | 11 | runs-on: ubuntu-latest |
| 12 | + permissions: |
| 13 | + contents: write |
| 14 | + id-token: write |
| 12 | 15 | |
| 13 | 16 | steps: |
| 14 | | - - uses: actions/checkout@v6 |
| 17 | + - name: Checkout |
| 18 | + uses: actions/checkout@v4 |
| 15 | 19 | with: |
| 16 | 20 | fetch-depth: 0 |
| 17 | 21 | |
| 18 | | - - name: Install Bun |
| 19 | | - uses: oven-sh/setup-bun@v2 |
| 20 | | - |
| 21 | | - - name: Use cached node_modules |
| 22 | | - uses: actions/cache@v4 |
| 22 | + - name: Setup Node.js |
| 23 | + uses: actions/setup-node@v4 |
| 23 | 24 | with: |
| 24 | | - path: node_modules |
| 25 | | - key: node-modules-${{ hashFiles('**/bun.lock') }} |
| 26 | | - restore-keys: | |
| 27 | | - node-modules- |
| 25 | + node-version: '24' |
| 26 | + registry-url: 'https://registry.npmjs.org' |
| 28 | 27 | |
| 29 | | - - name: Install Dependencies |
| 30 | | - run: bun install |
| 28 | + - name: Setup Zig |
| 29 | + run: | |
| 30 | + curl -L https://ziglang.org/builds/zig-x86_64-linux-0.16.0-dev.1859+212968c57.tar.xz -o zig.tar.xz |
| 31 | + tar -xf zig.tar.xz |
| 32 | + mv zig-x86_64-linux-0.16.0-dev.1859+212968c57 zig |
| 33 | + echo "$PWD/zig" >> $GITHUB_PATH |
| 31 | 34 | |
| 32 | | - - name: Publish to npm |
| 33 | | - run: bun publish --access public |
| 34 | | - env: |
| 35 | | - BUN_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} |
| 35 | + - name: Verify Zig |
| 36 | + run: zig version |
| 36 | 37 | |
| 37 | | - - name: Create GitHub release |
| 38 | | - run: bunx changelogithub |
| 39 | | - env: |
| 40 | | - GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} |
| 38 | + - name: Build pantry from source |
| 39 | + run: | |
| 40 | + git clone --depth 1 https://github.com/home-lang/pantry.git ../pantry |
| 41 | + cd ../pantry/packages/zig |
| 42 | + mkdir -p pantry |
| 43 | + cd pantry |
| 44 | + git clone --depth 1 https://github.com/zig-utils/zig-cli.git |
| 45 | + git clone --depth 1 https://github.com/zig-utils/zig-config.git |
| 46 | + git clone --depth 1 https://github.com/zig-utils/zig-test-framework.git |
| 41 | 47 | |
| 42 | | - - name: Attach Binaries |
| 43 | | - uses: stacksjs/action-releaser@v1.2.7 |
| 48 | + - name: Compile pantry |
| 49 | + run: | |
| 50 | + cd ../pantry/packages/zig |
| 51 | + zig build |
| 52 | + echo "$PWD/zig-out/bin" >> $GITHUB_PATH |
| 53 | + |
| 54 | + - name: Create GitHub Release |
| 55 | + uses: softprops/action-gh-release@v2.5.0 |
| 44 | 56 | with: |
| 45 | | - files: | |
| 46 | | - bin/auth-linux-x64 |
| 47 | | - bin/auth-linux-arm64 |
| 48 | | - bin/auth-windows-x64.exe |
| 49 | | - bin/auth-darwin-x64 |
| 50 | | - bin/auth-darwin-arm64 |
| 57 | + generate_release_notes: true |
| 51 | 58 | env: |
| 52 | 59 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 60 | + |
| 61 | + - name: Publish |
| 62 | + run: pantry npm:publish --access public |
| 63 | + env: |
| 64 | + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |