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