diff options
| author | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-04-06 00:38:58 +0300 |
|---|---|---|
| committer | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-04-06 00:38:58 +0300 |
| commit | c113f5713fc759c128a4dc07149140956362cece (patch) | |
| tree | 6b95a9b6cf3cc6dd5fbedc33c901996a61cea015 /.github/workflows | |
| parent | 985b7f74e6e685313236d8a5ab007c69879f18dd (diff) | |
ci: fix manual artifact workflow filters
Diffstat (limited to '.github/workflows')
| -rw-r--r-- | .github/workflows/build-artifacts-manual.yml | 77 |
1 files changed, 60 insertions, 17 deletions
diff --git a/.github/workflows/build-artifacts-manual.yml b/.github/workflows/build-artifacts-manual.yml index 873f03a4..c880a852 100644 --- a/.github/workflows/build-artifacts-manual.yml +++ b/.github/workflows/build-artifacts-manual.yml @@ -30,7 +30,9 @@ env: FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true jobs: - build: + build-linux: + if: ${{ inputs.build_group == 'linux' || inputs.build_group == 'all' }} + runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: @@ -38,22 +40,72 @@ jobs: - target: x86_64-unknown-linux-musl os: ubuntu-latest name: herdr-linux-x86_64 - group: linux - target: aarch64-unknown-linux-musl os: ubuntu-latest name: herdr-linux-aarch64 - group: linux + env: + LIBGHOSTTY_VT_OPTIMIZE: ${{ inputs.libghostty_optimize }} + + steps: + - uses: actions/checkout@v4 + + - name: Install Rust + uses: dtolnay/rust-toolchain@stable + with: + targets: ${{ matrix.target }} + + - name: Install Zig + uses: mlugg/setup-zig@v2 + with: + version: 0.15.2 + + - name: Install Linux build tools + run: sudo apt-get update && sudo apt-get install -y cmake ninja-build musl-tools gcc-aarch64-linux-gnu crossbuild-essential-arm64 + + - name: Set Linux aarch64 linker + if: matrix.target == 'aarch64-unknown-linux-musl' + run: echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_LINKER=aarch64-linux-gnu-gcc" >> $GITHUB_ENV + + - name: Remove Zig caches + run: rm -rf .zig-cache vendor/libghostty-vt/.zig-cache vendor/libghostty-vt/zig-out + + - name: Build + run: cargo build --release --locked --target ${{ matrix.target }} + + - name: Package artifact + run: | + cp target/${{ matrix.target }}/release/herdr ${{ matrix.name }} + ./${{ matrix.name }} --version + file ${{ matrix.name }} > BUILD_INFO.txt + { + echo "commit=$GITHUB_SHA" + echo "target=${{ matrix.target }}" + echo "libghostty_vt_optimize=$LIBGHOSTTY_VT_OPTIMIZE" + } >> BUILD_INFO.txt + python3 -c "import hashlib, pathlib; artifact = pathlib.Path('${{ matrix.name }}'); print(f'sha256={hashlib.sha256(artifact.read_bytes()).hexdigest()} {artifact.name}')" >> BUILD_INFO.txt + + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: ${{ matrix.name }}-${{ inputs.libghostty_optimize }} + path: | + ${{ matrix.name }} + BUILD_INFO.txt + retention-days: 7 + + build-macos: + if: ${{ inputs.build_group == 'macos' || inputs.build_group == 'all' }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + include: - target: x86_64-apple-darwin os: macos-latest name: herdr-macos-x86_64 - group: macos - target: aarch64-apple-darwin os: macos-latest name: herdr-macos-aarch64 - group: macos - - if: ${{ inputs.build_group == 'all' || inputs.build_group == matrix.group }} - runs-on: ${{ matrix.os }} env: LIBGHOSTTY_VT_OPTIMIZE: ${{ inputs.libghostty_optimize }} @@ -70,18 +122,9 @@ jobs: with: version: 0.15.2 - - name: Install Linux build tools - if: runner.os == 'Linux' - run: sudo apt-get update && sudo apt-get install -y cmake ninja-build musl-tools gcc-aarch64-linux-gnu crossbuild-essential-arm64 - - name: Install macOS build tools - if: runner.os == 'macOS' run: brew install cmake ninja - - name: Set Linux aarch64 linker - if: matrix.target == 'aarch64-unknown-linux-musl' - run: echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_LINKER=aarch64-linux-gnu-gcc" >> $GITHUB_ENV - - name: Remove Zig caches run: rm -rf .zig-cache vendor/libghostty-vt/.zig-cache vendor/libghostty-vt/zig-out |
