π fix JSR publish: update include list and add version constraint #17
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: Publish | |
| on: | |
| push: | |
| tags: | |
| - v* | |
| permissions: | |
| contents: write | |
| id-token: write | |
| jobs: | |
| verify-jsr: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: checkout | |
| uses: actions/checkout@v4 | |
| - name: setup deno | |
| uses: denoland/setup-deno@v2 | |
| with: | |
| deno-version: v2.x | |
| - name: Get Version | |
| id: vars | |
| run: echo ::set-output name=version::$(echo ${{github.ref_name}} | sed 's/^v//') | |
| - name: Build JSR | |
| run: deno task build:jsr ${{steps.vars.outputs.version}} | |
| - name: dry run publish | |
| run: npx jsr publish --dry-run --allow-dirty | |
| verify-npm: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: checkout | |
| uses: actions/checkout@v4 | |
| - name: setup deno | |
| uses: denoland/setup-deno@v2 | |
| with: | |
| deno-version: v2.x | |
| - name: Get Version | |
| id: vars | |
| run: echo ::set-output name=version::$(echo ${{github.ref_name}} | sed 's/^v//') | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 24 | |
| - name: Build NPM | |
| run: deno task build:npm ${{steps.vars.outputs.version}} | |
| - name: dry run publish | |
| run: npm publish --dry-run --tag=verify | |
| working-directory: ./build/npm | |
| - name: upload build | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: npm-build | |
| path: ./build/npm | |
| publish-npm: | |
| needs: [verify-jsr, verify-npm] | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| id-token: write | |
| steps: | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 24 | |
| - name: download build | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: npm-build | |
| path: ./build/npm | |
| - name: Publish NPM | |
| run: npm publish --access=public --provenance --tag=latest | |
| working-directory: ./build/npm | |
| publish-jsr: | |
| needs: [verify-jsr, verify-npm] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: checkout | |
| uses: actions/checkout@v4 | |
| - name: setup deno | |
| uses: denoland/setup-deno@v2 | |
| with: | |
| deno-version: v2.x | |
| - name: Get Version | |
| id: vars | |
| run: echo ::set-output name=version::$(echo ${{github.ref_name}} | sed 's/^v//') | |
| - name: Build JSR | |
| run: deno task build:jsr ${{steps.vars.outputs.version}} | |
| - name: Publish JSR | |
| run: npx jsr publish --allow-dirty --token=${{secrets.JSR_API}} | |
| release: | |
| needs: [verify-jsr, verify-npm] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: denoland/setup-deno@v2 | |
| with: | |
| deno-version: v2.x | |
| - run: mkdir bin | |
| - name: Compile for Linux arm64 | |
| run: | | |
| deno compile \ | |
| --target=aarch64-unknown-linux-gnu \ | |
| --output=bin/staticalize-linux-arm64 \ | |
| --include=deno.json \ | |
| --allow-read --allow-write --allow-net --allow-env main.ts | |
| - name: Compile for macOS arm64 | |
| run: | | |
| deno compile \ | |
| --target=aarch64-apple-darwin \ | |
| --output=bin/staticalize-macos-arm64 \ | |
| --include=deno.json \ | |
| --allow-read --allow-write --allow-net --allow-env main.ts | |
| - name: Compile for Linux x64 | |
| run: | | |
| deno compile \ | |
| --target=x86_64-unknown-linux-gnu \ | |
| --output=bin/staticalize-linux \ | |
| --include=deno.json \ | |
| --allow-read --allow-write --allow-net --allow-env main.ts | |
| - name: Compile for Windows x64 | |
| run: | | |
| deno compile \ | |
| --target=x86_64-pc-windows-msvc \ | |
| --output=bin/staticalize-windows \ | |
| --include=deno.json \ | |
| --allow-read --allow-write --allow-net --allow-env main.ts | |
| - name: Compile for macOS x64 | |
| run: | | |
| deno compile \ | |
| --target=x86_64-apple-darwin \ | |
| --output=bin/staticalize-macos \ | |
| --include=deno.json \ | |
| --allow-read --allow-write --allow-net --allow-env main.ts | |
| - name: Compress binaries | |
| run: | | |
| cd bin | |
| zip staticalize-windows.zip staticalize-windows.exe | |
| tar -czf staticalize-macos.tar.gz staticalize-macos | |
| tar -czf staticalize-macos-arm64.tar.gz staticalize-macos-arm64 | |
| tar -czf staticalize-linux.tar.gz staticalize-linux | |
| tar -czf staticalize-linux-arm64.tar.gz staticalize-linux-arm64 | |
| rm staticalize-windows.exe \ | |
| staticalize-macos \ | |
| staticalize-macos-arm64 \ | |
| staticalize-linux \ | |
| staticalize-linux-arm64 | |
| - name: Upload to Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| token: ${{ secrets.FRONTSIDEJACK_GITHUB_TOKEN }} | |
| make_latest: true | |
| files: bin/* |