Update release.yml

This commit is contained in:
Alexey 2026-03-21 16:48:42 +03:00 committed by GitHub
parent c4e7f54cbe
commit b91c6cb339
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 16 additions and 26 deletions

View File

@ -59,7 +59,6 @@ jobs:
image: debian:trixie image: debian:trixie
steps: steps:
- name: Install system dependencies - name: Install system dependencies
shell: bash
run: | run: |
set -euo pipefail set -euo pipefail
apt-get update apt-get update
@ -93,20 +92,15 @@ jobs:
checks-${{ runner.os }}- checks-${{ runner.os }}-
- name: Cargo fetch - name: Cargo fetch
shell: bash
run: cargo fetch --locked run: cargo fetch --locked
- name: Format - name: Format
shell: bash
run: cargo fmt --all -- --check run: cargo fmt --all -- --check
- name: Clippy - name: Clippy
shell: bash run: cargo clippy
run: |
cargo clippy
- name: Tests - name: Tests
shell: bash
run: cargo test run: cargo test
build-binaries: build-binaries:
@ -134,7 +128,6 @@ jobs:
steps: steps:
- name: Install system dependencies - name: Install system dependencies
shell: bash
run: | run: |
set -euo pipefail set -euo pipefail
apt-get update apt-get update
@ -171,18 +164,15 @@ jobs:
build-${{ matrix.zig_target }}- build-${{ matrix.zig_target }}-
- name: Install cargo-zigbuild + Zig - name: Install cargo-zigbuild + Zig
shell: bash
run: | run: |
set -euo pipefail set -euo pipefail
python3 -m pip install --user --break-system-packages cargo-zigbuild python3 -m pip install --user --break-system-packages cargo-zigbuild
echo "/github/home/.local/bin" >> "$GITHUB_PATH" echo "/github/home/.local/bin" >> "$GITHUB_PATH"
- name: Cargo fetch - name: Cargo fetch
shell: bash
run: cargo fetch --locked run: cargo fetch --locked
- name: Build release - name: Build release
shell: bash
env: env:
CARGO_PROFILE_RELEASE_LTO: "fat" CARGO_PROFILE_RELEASE_LTO: "fat"
CARGO_PROFILE_RELEASE_CODEGEN_UNITS: "1" CARGO_PROFILE_RELEASE_CODEGEN_UNITS: "1"
@ -191,27 +181,33 @@ jobs:
set -euo pipefail set -euo pipefail
cargo zigbuild --release --locked --target "${{ matrix.zig_target }}" cargo zigbuild --release --locked --target "${{ matrix.zig_target }}"
- name: Strip binary - name: Debug target dir (optional but useful)
shell: bash
run: | run: |
set -euo pipefail set -euo pipefail
llvm-strip "target/${{ matrix.zig_target }}/release/${BINARY_NAME}" || true ls -lah "target/${{ matrix.rust_target }}/release/" || true
- name: Strip binary
run: |
set -euo pipefail
llvm-strip "target/${{ matrix.rust_target }}/release/${BINARY_NAME}" || true
- name: Inspect binary - name: Inspect binary
shell: bash
run: | run: |
set -euo pipefail set -euo pipefail
file "target/${{ matrix.zig_target }}/release/${BINARY_NAME}" file "target/${{ matrix.rust_target }}/release/${BINARY_NAME}"
- name: Package - name: Package
shell: bash
run: | run: |
set -euo pipefail set -euo pipefail
BIN_PATH="target/${{ matrix.rust_target }}/release/${BINARY_NAME}"
test -f "$BIN_PATH"
OUTDIR="$RUNNER_TEMP/pkg/${{ matrix.asset_name }}" OUTDIR="$RUNNER_TEMP/pkg/${{ matrix.asset_name }}"
mkdir -p "$OUTDIR" mkdir -p "$OUTDIR"
install -m 0755 "target/${{ matrix.zig_target }}/release/${BINARY_NAME}" "$OUTDIR/${BINARY_NAME}" install -m 0755 "$BIN_PATH" "$OUTDIR/${BINARY_NAME}"
if [[ -f LICENSE ]]; then cp LICENSE "$OUTDIR/"; fi if [[ -f LICENSE ]]; then cp LICENSE "$OUTDIR/"; fi
if [[ -f README.md ]]; then cp README.md "$OUTDIR/"; fi if [[ -f README.md ]]; then cp README.md "$OUTDIR/"; fi
@ -253,7 +249,6 @@ jobs:
path: dist path: dist
- name: Flatten artifacts - name: Flatten artifacts
shell: bash
run: | run: |
set -euo pipefail set -euo pipefail
mkdir -p upload mkdir -p upload
@ -276,11 +271,8 @@ jobs:
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: Set up QEMU - uses: docker/setup-qemu-action@v3
uses: docker/setup-qemu-action@v3 - uses: docker/setup-buildx-action@v3
- name: Set up Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to GHCR - name: Log in to GHCR
if: ${{ needs.prepare.outputs.release_enabled == 'true' }} if: ${{ needs.prepare.outputs.release_enabled == 'true' }}
@ -306,7 +298,6 @@ jobs:
org.opencontainers.image.revision=${{ github.sha }} org.opencontainers.image.revision=${{ github.sha }}
- name: Build and push - name: Build and push
id: build
uses: docker/build-push-action@v6 uses: docker/build-push-action@v6
with: with:
context: . context: .
@ -337,7 +328,6 @@ jobs:
path: release-artifacts path: release-artifacts
- name: Flatten artifacts - name: Flatten artifacts
shell: bash
run: | run: |
set -euo pipefail set -euo pipefail
mkdir -p upload mkdir -p upload