diff --git a/.forgejo/workflows/release.yaml b/.forgejo/workflows/release.yaml index 16122a8..7b8fa84 100644 --- a/.forgejo/workflows/release.yaml +++ b/.forgejo/workflows/release.yaml @@ -17,7 +17,7 @@ jobs: - target: x86_64-unknown-linux-gnu cross: true platform: linux/amd64 - deps: "gcc-x86-64-linux-gnu libc6-dev-amd64-cross" + deps: "build-essential gcc-x86-64-linux-gnu libc6-dev-amd64-cross pkg-config" env: CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER: x86_64-linux-gnu-gcc @@ -38,10 +38,6 @@ jobs: with: toolchain: stable - - name: Add Rust target - if: matrix.target != 'native' - run: rustup target add ${{ matrix.target }} - - name: Cache Rust dependencies uses: https://code.forgejo.org/actions/cache@v4 with: @@ -76,14 +72,15 @@ jobs: with: args: > sh -c " - apt-get update && apt-get install -y build-essential ${{ matrix.deps }} pkg-config && + rustup target add ${{ matrix.target }} && + apt-get update && apt-get install -y ${{ matrix.deps }} && mkdir -p ~/.cargo && - echo '[target.x86_64-unknown-linux-gnu]\nlinker = \"x86_64-linux-gnu-gcc\"' > ~/.cargo/config.toml && - cargo build --release --target x86_64-unknown-linux-gnu && + echo '[target.${{ matrix.target }}]\nlinker = \"x86_64-linux-gnu-gcc\"' > ~/.cargo/config.toml && + cargo build --release --target ${{ matrix.target }} && mkdir -p release-artifacts && - cp target/x86_64-unknown-linux-gnu/release/uptime-kuma-dashboard release-artifacts/uptime-kuma-dashboard-x86_64-unknown-linux-gnu && - strip release-artifacts/uptime-kuma-dashboard-x86_64-unknown-linux-gnu && - chmod +x release-artifacts/uptime-kuma-dashboard-x86_64-unknown-linux-gnu" + cp target/${{ matrix.target }}/release/uptime-kuma-dashboard release-artifacts/uptime-kuma-dashboard-${{ matrix.target }} && + strip release-artifacts/uptime-kuma-dashboard-${{ matrix.target }} && + chmod +x release-artifacts/uptime-kuma-dashboard-${{ matrix.target }}" env: ${{ matrix.env }} options: --platform ${{ matrix.platform }} @@ -93,10 +90,11 @@ jobs: with: args: > sh -c " + rustup target add ${{ matrix.target }} && apt-get update && apt-get install -y ${{ matrix.deps }} && - cargo build --release --target x86_64-pc-windows-gnu && + cargo build --release --target ${{ matrix.target }} && mkdir -p release-artifacts && - cp target/x86_64-pc-windows-gnu/release/uptime-kuma-dashboard.exe release-artifacts/uptime-kuma-dashboard-x86_64-pc-windows-gnu.exe && + cp target/${{ matrix.target }}/release/uptime-kuma-dashboard.exe release-artifacts/uptime-kuma-dashboard-${{ matrix.target }}.exe && ls -lh release-artifacts/" env: ${{ matrix.env }} options: --platform ${{ matrix.platform }}