refactor: move Claude Code section to top and remove temp files #15
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
| # ============================================================================= | |
| # CI & Release | |
| # ============================================================================= | |
| # Runs on tag push to build release binaries and create GitHub release. | |
| # ============================================================================= | |
| name: CI | |
| on: | |
| push: | |
| tags: | |
| - "v[0-9]+.[0-9]+.[0-9]+" # v1.0.0 | |
| - "v[0-9]+.[0-9]+.[0-9]+-*" # v1.0.0-beta.1, v1.0.0-rc.1 | |
| permissions: | |
| contents: write | |
| env: | |
| CARGO_TERM_COLOR: always | |
| BINARY_NAME: termstack | |
| jobs: | |
| # --------------------------------------------------------------------------- | |
| # Build Binaries | |
| # --------------------------------------------------------------------------- | |
| build: | |
| name: Build (${{ matrix.name }}) | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| # macOS Intel | |
| - os: macos-latest | |
| target: x86_64-apple-darwin | |
| name: macos-amd64 | |
| artifact: termstack-macos-amd64 | |
| # macOS Apple Silicon | |
| - os: macos-latest | |
| target: aarch64-apple-darwin | |
| name: macos-arm64 | |
| artifact: termstack-macos-arm64 | |
| # Linux x86_64 | |
| - os: ubuntu-latest | |
| target: x86_64-unknown-linux-gnu | |
| name: linux-amd64 | |
| artifact: termstack-linux-amd64 | |
| # Linux ARM64 | |
| - os: ubuntu-latest | |
| target: aarch64-unknown-linux-gnu | |
| name: linux-arm64 | |
| artifact: termstack-linux-arm64 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: ${{ matrix.target }} | |
| - name: Install cross-compilation tools (Linux ARM) | |
| if: matrix.target == 'aarch64-unknown-linux-gnu' | |
| run: | | |
| cargo install cross --git https://github.com/cross-rs/cross | |
| - name: Cache cargo | |
| uses: Swatinem/rust-cache@v2 | |
| with: | |
| key: ${{ matrix.target }} | |
| - name: Build (native) | |
| if: matrix.target != 'aarch64-unknown-linux-gnu' | |
| run: cargo build --release --target ${{ matrix.target }} | |
| - name: Build (cross) | |
| if: matrix.target == 'aarch64-unknown-linux-gnu' | |
| run: cross build --release --target ${{ matrix.target }} | |
| - name: Package binary | |
| run: | | |
| cd target/${{ matrix.target }}/release | |
| tar czvf ../../../${{ matrix.artifact }}.tar.gz ${{ env.BINARY_NAME }} | |
| cd ../../.. | |
| - name: Generate checksum | |
| run: | | |
| if [ "${{ matrix.os }}" = "macos-latest" ]; then | |
| shasum -a 256 ${{ matrix.artifact }}.tar.gz > ${{ matrix.artifact }}.sha256 | |
| else | |
| sha256sum ${{ matrix.artifact }}.tar.gz > ${{ matrix.artifact }}.sha256 | |
| fi | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ${{ matrix.artifact }} | |
| path: | | |
| ${{ matrix.artifact }}.tar.gz | |
| ${{ matrix.artifact }}.sha256 | |
| # --------------------------------------------------------------------------- | |
| # Create Release | |
| # --------------------------------------------------------------------------- | |
| release: | |
| name: Create Release | |
| needs: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: artifacts | |
| - name: Prepare release files | |
| run: | | |
| mkdir -p release | |
| find artifacts -type f \( -name "*.tar.gz" -o -name "*.sha256" \) -exec mv {} release/ \; | |
| ls -la release/ | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| files: release/* | |
| generate_release_notes: true | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |