Bump version to 0.5.0 #6
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*' | |
| jobs: | |
| binaries: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - target: bun-linux-x64 | |
| name: linux-x64 | |
| archive: tar.gz | |
| - target: bun-linux-arm64 | |
| name: linux-arm64 | |
| archive: tar.gz | |
| - target: bun-darwin-x64 | |
| name: darwin-x64 | |
| archive: tar.gz | |
| - target: bun-darwin-arm64 | |
| name: darwin-arm64 | |
| archive: tar.gz | |
| - target: bun-windows-x64 | |
| name: windows-x64 | |
| archive: zip | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Bun | |
| uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - name: Install dependencies | |
| run: bun install | |
| - name: Set version from tag | |
| id: version | |
| run: | | |
| VERSION=${GITHUB_REF#refs/tags/v} | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| - name: Compile binary | |
| run: | | |
| mkdir -p dist-binaries | |
| BINARY_NAME="workout" | |
| if [[ "${{ matrix.name }}" == windows-* ]]; then | |
| BINARY_NAME="workout.exe" | |
| fi | |
| bun build ./src/index.ts --compile --target=${{ matrix.target }} --minify --outfile=dist-binaries/$BINARY_NAME | |
| - name: Create archive | |
| run: | | |
| VERSION=${{ steps.version.outputs.version }} | |
| ARCHIVE_DIR="workout-${VERSION}-${{ matrix.name }}" | |
| mkdir -p "$ARCHIVE_DIR" | |
| if [[ "${{ matrix.name }}" == windows-* ]]; then | |
| cp dist-binaries/workout.exe "$ARCHIVE_DIR/" | |
| else | |
| cp dist-binaries/workout "$ARCHIVE_DIR/" | |
| fi | |
| if [[ "${{ matrix.archive }}" == "tar.gz" ]]; then | |
| tar -czvf "dist-binaries/workout-${VERSION}-${{ matrix.name }}.tar.gz" "$ARCHIVE_DIR" | |
| else | |
| zip -r "dist-binaries/workout-${VERSION}-${{ matrix.name }}.zip" "$ARCHIVE_DIR" | |
| fi | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: binary-${{ matrix.name }} | |
| path: dist-binaries/workout-*.* | |
| retention-days: 1 | |
| release: | |
| needs: binaries | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: dist-binaries | |
| pattern: binary-* | |
| merge-multiple: true | |
| - name: Generate checksums | |
| run: | | |
| cd dist-binaries | |
| sha256sum workout-*.tar.gz workout-*.zip > checksums.txt | |
| cat checksums.txt | |
| - name: Upload to GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: | | |
| dist-binaries/*.tar.gz | |
| dist-binaries/*.zip | |
| dist-binaries/checksums.txt | |
| fail_on_unmatched_files: true | |
| generate_release_notes: true |