v1.0.5 #30
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: NPM CD | |
| run-name: ${{ github.ref_name }} | |
| permissions: | |
| contents: write | |
| packages: write | |
| attestations: write | |
| id-token: write | |
| on: | |
| release: | |
| types: | |
| - published | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref_name }} | |
| cancel-in-progress: true | |
| env: | |
| REPO: ${{ github.repository }} | |
| VERSION: ${{ github.ref_name }} | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| registry: | |
| - url: https://npm.pkg.github.com | |
| token: 'GITHUB_TOKEN' | |
| scope: '@${{ github.repository_owner }}' | |
| - url: https://registry.npmjs.org | |
| token: 'NPM_TOKEN' | |
| scope: '@${{ github.repository_owner }}' | |
| steps: | |
| - name: 📥 Checkout Repo | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: 🛠️ Setup Bun | |
| uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| registry-url: ${{ matrix.registry.url }} | |
| scope: ${{ matrix.registry.scope }} | |
| - name: 📦 Install Dependencies | |
| run: bun install --frozen-lockfile | |
| - name: ⚙️ Publish Package | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets[matrix.registry.token] }} | |
| REGISTRY_URL: ${{ matrix.registry.url }} | |
| run: | | |
| CLEAN_URL="${REGISTRY_URL#https://}" | |
| echo "//${CLEAN_URL}/:_authToken=${NODE_AUTH_TOKEN}" > ./.npmrc | |
| echo "registry=${REGISTRY_URL}" >> ./.npmrc | |
| bun publish --no-git-checks --access public | |
| rm ./.npmrc | |
| build-cli: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - platform: 'macos-latest' # for Arm based macs (M1 and above). | |
| name: macos-arm64 | |
| args: '--target aarch64-apple-darwin' | |
| ext: '' | |
| - platform: 'macos-latest' # for Intel based macs. | |
| name: macos-x64 | |
| args: '--target x86_64-apple-darwin' | |
| ext: '' | |
| - platform: 'ubuntu-latest' | |
| name: linux-x64 | |
| args: '' | |
| ext: '' | |
| - platform: 'windows-latest' | |
| name: windows-x64 | |
| args: '' | |
| ext: '.exe' | |
| runs-on: ${{ matrix.platform }} | |
| steps: | |
| - name: 📥 Checkout Repo | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: 🛠️ Setup Bun | |
| uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - name: 📦 Install Dependencies | |
| run: bun install --frozen-lockfile | |
| - name: ⚙️ Build Artifact | |
| run: bun run bun:build | |
| - name: ⚙️ Upload Artifact | |
| uses: svenstaro/upload-release-action@v2 | |
| with: | |
| repo_token: ${{ secrets.GITHUB_TOKEN }} | |
| file: dist/bin/cli${{ matrix.ext }} | |
| asset_name: unstack_${{ env.VERSION }}_${{ matrix.name }}${{ matrix.ext }} | |
| tag: ${{ env.VERSION }} |