chore: release v0.0.58 #59
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 Binaries | |
| env: | |
| BUN_VERSION: 1.3.14 | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| strategy: | |
| matrix: | |
| include: | |
| # macOS | |
| - os: macos-latest | |
| target: darwin-x64 | |
| artifact: ycy-macos-x64 | |
| - os: macos-latest | |
| target: darwin-arm64 | |
| artifact: ycy-macos-arm64 | |
| # Linux | |
| - os: ubuntu-latest | |
| target: linux-x64 | |
| artifact: ycy-linux-x64 | |
| - os: ubuntu-latest | |
| target: linux-arm64 | |
| artifact: ycy-linux-arm64 | |
| # Windows | |
| - os: windows-latest | |
| target: windows-x64 | |
| artifact: ycy-windows-x64.exe | |
| # Bun 1.3.14 cannot cross-compile Windows ARM64 from a Windows host. | |
| - os: ubuntu-latest | |
| target: windows-arm64 | |
| artifact: ycy-windows-arm64.exe | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: ${{ env.BUN_VERSION }} | |
| - name: Install dependencies | |
| run: bun install --frozen-lockfile | |
| - name: Build binary | |
| shell: bash | |
| run: | | |
| bun scripts/build.ts \ | |
| --target bun-${{ matrix.target }} \ | |
| --outfile ${{ matrix.artifact }} | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.artifact }} | |
| path: ${{ matrix.artifact }} | |
| if-no-files-found: error | |
| release: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: dist | |
| - name: List downloaded files | |
| run: | | |
| ls -R dist/ | |
| - name: Generate checksums | |
| run: | | |
| : > dist/SHA256SUMS | |
| for file in dist/*/*; do | |
| sha256sum "$file" | awk -v name="$(basename "$file")" '{ print $1 " " name }' >> dist/SHA256SUMS | |
| done | |
| cat dist/SHA256SUMS | |
| - name: Create Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| draft: false | |
| generate_release_notes: true | |
| files: | | |
| dist/ycy-macos-x64/ycy-macos-x64 | |
| dist/ycy-macos-arm64/ycy-macos-arm64 | |
| dist/ycy-linux-x64/ycy-linux-x64 | |
| dist/ycy-linux-arm64/ycy-linux-arm64 | |
| dist/ycy-windows-x64.exe/ycy-windows-x64.exe | |
| dist/ycy-windows-arm64.exe/ycy-windows-arm64.exe | |
| dist/SHA256SUMS | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| image: | |
| if: startsWith(github.ref, 'refs/tags/') | |
| needs: build | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Log in to GHCR | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and publish image | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| file: Dockerfile | |
| platforms: linux/amd64,linux/arm64 | |
| push: true | |
| tags: | | |
| ghcr.io/hackycy/hackycy-cli:${{ github.ref_name }} | |
| ghcr.io/hackycy/hackycy-cli:latest |