chore(release): 1.7.1 #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: Release | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| tag: | |
| description: 'Release tag (e.g., v0.1.0)' | |
| required: false | |
| push: | |
| tags: | |
| - "v*" | |
| jobs: | |
| create-release: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| outputs: | |
| version: ${{ steps.version.outputs.version }} | |
| tag: ${{ steps.version.outputs.tag }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v1 | |
| with: | |
| bun-version: "1.3.5" | |
| - name: Resolve version | |
| id: version | |
| run: | | |
| TARGET_TAG="${{ github.event.inputs.tag }}" | |
| if [ -z "$TARGET_TAG" ]; then | |
| TARGET_TAG="$GITHUB_REF_NAME" | |
| fi | |
| if [ -z "$TARGET_TAG" ]; then | |
| echo "Missing tag. Provide workflow input 'tag' or run on a tag ref." | |
| exit 1 | |
| fi | |
| VERSION="$(bun -e "const pkg = await Bun.file('package.json').json(); console.log(pkg.version)")" | |
| if [ "v$VERSION" != "$TARGET_TAG" ]; then | |
| echo "Tag $TARGET_TAG does not match package.json version $VERSION." | |
| exit 1 | |
| fi | |
| echo "tag=$TARGET_TAG" >> "$GITHUB_OUTPUT" | |
| echo "version=$VERSION" >> "$GITHUB_OUTPUT" | |
| - name: Create GitHub release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: "${{ steps.version.outputs.tag }}" | |
| generate_release_notes: true | |
| build: | |
| needs: create-release | |
| runs-on: ${{ matrix.os }} | |
| permissions: | |
| contents: write | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: ubuntu-latest | |
| upload_install: true | |
| skip_tests: true | |
| - os: macos-15 | |
| upload_install: false | |
| skip_tests: true | |
| - os: macos-15-large | |
| upload_install: false | |
| skip_tests: true | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v1 | |
| with: | |
| bun-version: "1.3.5" | |
| - name: Install dependencies | |
| run: bun install | |
| - name: Build release artifacts | |
| if: ${{ !matrix.skip_tests }} | |
| run: bun run build:release --version="${{ needs.create-release.outputs.version }}" | |
| - name: Build release artifacts (skip tests) | |
| if: ${{ matrix.skip_tests }} | |
| run: bun run build:release --version="${{ needs.create-release.outputs.version }}" --skip-tests | |
| - name: Upload tarball | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: "${{ needs.create-release.outputs.tag }}" | |
| fail_on_unmatched_files: true | |
| files: | | |
| dist/release/hack-${{ needs.create-release.outputs.version }}-*.tar.gz | |
| - name: Upload install scripts | |
| if: ${{ matrix.upload_install }} | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: "${{ needs.create-release.outputs.tag }}" | |
| fail_on_unmatched_files: true | |
| files: | | |
| dist/release/hack-${{ needs.create-release.outputs.version }}-install.sh | |
| dist/release/hack-install.sh | |
| macos-app: | |
| needs: [create-release, build] | |
| permissions: | |
| contents: write | |
| uses: ./.github/workflows/release-macos-app.yml | |
| with: | |
| tag: ${{ needs.create-release.outputs.tag }} | |
| secrets: inherit |