tui-release #13
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: tui-release | |
| on: | |
| push: | |
| tags: | |
| - "tui-v*" | |
| - "v*" | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| build-binaries: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: ubuntu-latest | |
| asset_name: cable-intel-tui-linux-x64 | |
| exec_name: cable-intel-tui-linux-x64 | |
| - os: macos-14 | |
| asset_name: cable-intel-tui-macos-arm64 | |
| exec_name: cable-intel-tui-macos-arm64 | |
| - os: windows-latest | |
| asset_name: cable-intel-tui-windows-x64.exe | |
| exec_name: cable-intel-tui-windows-x64.exe | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Bun | |
| uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: 1.3.8 | |
| - name: Install dependencies (unix) | |
| if: runner.os != 'Windows' | |
| run: bun install --frozen-lockfile | |
| shell: bash | |
| - name: Build + smoke test (unix) | |
| if: runner.os != 'Windows' | |
| shell: bash | |
| run: | | |
| set -euo pipefail | |
| mkdir -p apps/tui/dist | |
| bun build apps/tui/src/index.tsx --compile --outfile "apps/tui/dist/${{ matrix.exec_name }}" | |
| "./apps/tui/dist/${{ matrix.exec_name }}" --help | |
| shasum -a 256 "apps/tui/dist/${{ matrix.exec_name }}" > "apps/tui/dist/${{ matrix.exec_name }}.sha256" | |
| - name: Install dependencies (windows) | |
| if: runner.os == 'Windows' | |
| shell: pwsh | |
| run: bun install --frozen-lockfile | |
| - name: Build + smoke test (windows) | |
| if: runner.os == 'Windows' | |
| shell: pwsh | |
| run: | | |
| New-Item -ItemType Directory -Force -Path apps/tui/dist | Out-Null | |
| bun build apps/tui/src/index.tsx --compile --outfile "apps/tui/dist/${{ matrix.exec_name }}" | |
| & "apps/tui/dist/${{ matrix.exec_name }}" --help | |
| $hash = (Get-FileHash -Path "apps/tui/dist/${{ matrix.exec_name }}" -Algorithm SHA256).Hash.ToLower() | |
| "$hash *${{ matrix.exec_name }}" | Set-Content "apps/tui/dist/${{ matrix.exec_name }}.sha256" | |
| - name: Upload binary artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.asset_name }} | |
| path: | | |
| apps/tui/dist/${{ matrix.exec_name }} | |
| apps/tui/dist/${{ matrix.exec_name }}.sha256 | |
| if-no-files-found: error | |
| publish-release: | |
| if: startsWith(github.ref, 'refs/tags/') | |
| needs: build-binaries | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Download artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: release-assets | |
| merge-multiple: true | |
| - name: Publish release assets | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ github.ref_name }} | |
| generate_release_notes: true | |
| files: release-assets/* |