From 7624e0e5bf2732757cf4dd8fa0150a32ac7f7699 Mon Sep 17 00:00:00 2001 From: Ross Younger Date: Sun, 12 Jan 2025 14:31:45 +1300 Subject: [PATCH] temp: making ci work --- .github/workflows/ci.yml | 39 +++++++++++++++-------------- .github/workflows/release.yml | 47 +++++++++++++++++++++-------------- Cargo.toml | 1 + 3 files changed, 51 insertions(+), 36 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 687bb0f..fa19426 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -56,28 +56,31 @@ jobs: run: scripts/install-ubuntu-packages # native builds need all of these; cross builds only need binutils-multiarch - #- name: Build - # run: cross build --release --locked --target ${{ matrix.target }} - - uses: taiki-e/upload-rust-binary-action@v1.24.0 - id: build + - name: Build + run: | + docker run --rm -v $PWD:/workspace -w /workspace \ + -v ~/.cargo/git:/root/.cargo/git \ + -v ~/.cargo/registry:/root/.cargo/registry \ + rust:slim sh -c " + apt-get update && apt-get install -y capnproto + cargo install cross + cross build --release --locked --target ${{ matrix.target }} + " + - name: Package + run: | + mkdir -p target/qcp-${{matrix.target}} && + cp README.md LICENSE CHANGELOG.md target/${{ matrix.target }}/release/qcp target/qcp-${{matrix.target}}/ && + tar -C target zcf qcp-${{ matrix.target }}.tar.gz qcp-${{matrix.target}} + + - name: Upload tar artifact + uses: actions/upload-artifact@v4 with: - bin: qcp - token: ${{ secrets.GITHUB_TOKEN }} - target: ${{ matrix.target }} - include: README.md,LICENSE,CHANGELOG.md - leading-dir: true - locked: true - tar: unix - zip: windows - dry_run: true + name: qcp-tarball-${{ matrix.target }} + path: target/qcp-${{ matrix.target }}.tar.gz + - name: Make deb package if: ${{ matrix.build_deb }} run: scripts/make-debian-package --no-release ${{ matrix.target }} - - name: Upload binary artifact - uses: actions/upload-artifact@v4 - with: - name: qcp-tarball-${{ matrix.target }} - path: ${{ steps.build.outputs.archive }}.tar.gz - name: Upload deb artifact if: ${{ matrix.build_deb }} uses: actions/upload-artifact@v4 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2be5e7d..bc2cc0e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -47,34 +47,45 @@ jobs: run: scripts/install-ubuntu-packages # native builds need all of these; cross builds only need binutils-multiarch - #- name: Build - # run: cross build --release --locked --target ${{ matrix.target }} - - uses: taiki-e/upload-rust-binary-action@v1.24.0 - id: build + - name: Build + run: | + docker run --rm -v $PWD:/workspace -w /workspace \ + -v ~/.cargo/git:/root/.cargo/git \ + -v ~/.cargo/registry:/root/.cargo/registry \ + rust:slim sh -c " + apt-get update && apt-get install -y capnproto + cargo install cross + cross build --release --locked --target ${{ matrix.target }} + " + - name: Package + run: | + mkdir -p target/qcp-${{matrix.target}} && + cp README.md LICENSE CHANGELOG.md target/${{ matrix.target }}/release/qcp target/qcp-${{matrix.target}}/ && + tar -C target zcf qcp-${{ matrix.target }}.tar.gz qcp-${{matrix.target}} + + - name: Upload tar artifact + uses: actions/upload-artifact@v4 with: - bin: qcp - token: ${{ secrets.GITHUB_TOKEN }} - target: ${{ matrix.target }} - include: README.md,LICENSE,CHANGELOG.md - leading-dir: true - locked: true - tar: unix - zip: windows - dry_run: ${{ github.event_name != 'release' }} + name: qcp-tarball-${{ matrix.target }} + path: target/qcp-${{ matrix.target }}.tar.gz + - name: Make deb package if: ${{ matrix.build_deb }} run: scripts/make-debian-package --release ${{ matrix.target }} - - name: Upload binary artifact - uses: actions/upload-artifact@v4 - with: - name: qcp-tarball-${{ matrix.target }} - path: ${{ steps.build.outputs.archive }}.tar.gz + - name: Upload deb artifact if: ${{ matrix.build_deb }} uses: actions/upload-artifact@v4 with: name: qcp-deb-${{ matrix.target }} path: ${{ env.BUILT_DEB_FILE }} + + - name: Publish tar package to release + if: ${{ github.event_name == 'release' }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: gh release upload ${{ github.ref_name }} target/qcp-${{ matrix.target }}.tar.gz + - name: Publish deb package to release if: ${{ matrix.build_deb }} && ${{ github.event_name == 'release' }} env: diff --git a/Cargo.toml b/Cargo.toml index 1505d41..5177a41 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,3 +10,4 @@ split-debuginfo="unpacked" [profile.release] lto = "thin" strip = "symbols" +