Releaser #10
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: Publish to NPM | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| workflow_dispatch: | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| id-token: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '24' | |
| registry-url: 'https://registry.npmjs.org' | |
| - name: Setup Zig | |
| run: | | |
| curl -L https://ziglang.org/builds/zig-x86_64-linux-0.16.0-dev.1859+212968c57.tar.xz -o zig.tar.xz | |
| tar -xf zig.tar.xz | |
| mv zig-x86_64-linux-0.16.0-dev.1859+212968c57 zig | |
| echo "$PWD/zig" >> $GITHUB_PATH | |
| - name: Verify Zig | |
| run: zig version | |
| - name: Build pantry from source | |
| run: | | |
| git clone --depth 1 https://github.com/home-lang/pantry.git ../pantry | |
| cd ../pantry/packages/zig | |
| mkdir -p pantry | |
| cd pantry | |
| git clone --depth 1 https://github.com/zig-utils/zig-cli.git | |
| git clone --depth 1 https://github.com/zig-utils/zig-config.git | |
| git clone --depth 1 https://github.com/zig-utils/zig-test-framework.git | |
| - name: Compile pantry | |
| run: | | |
| cd ../pantry/packages/zig | |
| zig build | |
| echo "$PWD/zig-out/bin" >> $GITHUB_PATH | |
| - name: Publish to npm | |
| run: pantry npm:publish --access public | |
| env: | |
| NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |