chore(release): 1.1.4 #8
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: release | |
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| strategy: | |
| matrix: | |
| include: | |
| - os: windows-latest | |
| asset: pkg-tui-x86_64-pc-windows-msvc.exe | |
| - os: ubuntu-latest | |
| asset: pkg-tui-x86_64-unknown-linux-gnu | |
| - os: macos-latest | |
| asset: pkg-tui-aarch64-apple-darwin | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - run: bun install --frozen-lockfile | |
| - run: bun run build | |
| - name: Rename for release | |
| shell: bash | |
| run: | | |
| mkdir -p dist/release | |
| if [ "${{ runner.os }}" = "Windows" ]; then | |
| cp dist/pkg-tui.exe "dist/release/${{ matrix.asset }}" | |
| else | |
| cp dist/pkg-tui "dist/release/${{ matrix.asset }}" | |
| fi | |
| - name: Upload release asset | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.asset }} | |
| path: dist/release/* | |
| release: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| path: artifacts | |
| merge-multiple: true | |
| - name: Create release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: artifacts/* | |
| generate_release_notes: true | |
| publish-npm: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - run: bun install --frozen-lockfile | |
| - name: Verify version matches tag | |
| shell: bash | |
| run: | | |
| VERSION=$(node -p "require('./package.json').version") | |
| TAG="${GITHUB_REF_NAME#v}" | |
| echo "package.json version: $VERSION, tag: $TAG" | |
| if [ "$VERSION" != "$TAG" ]; then | |
| echo "::error::package.json version ($VERSION) does not match tag ($TAG)" | |
| exit 1 | |
| fi | |
| - name: Publish to npm | |
| shell: bash | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| run: | | |
| echo "//registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN" > ~/.npmrc | |
| npm publish --registry=https://registry.npmjs.org --access=public |