From 9e51504b9ab2c807889661b260d190f35575c870 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tommi=20M=C3=A4klin?= Date: Mon, 18 Nov 2024 14:14:09 +0200 Subject: [PATCH] Remove CLI binary related workflows. --- .github/deploy/build_aarch64-apple-darwin.sh | 51 ---------- .github/deploy/build_x86_64-apple-darwin.sh | 51 ---------- .github/workflows/build_and_test.yml | 4 +- .github/workflows/build_artifacts.yml | 99 -------------------- .github/workflows/make_release.yml | 30 ------ 5 files changed, 2 insertions(+), 233 deletions(-) delete mode 100644 .github/deploy/build_aarch64-apple-darwin.sh delete mode 100644 .github/deploy/build_x86_64-apple-darwin.sh delete mode 100644 .github/workflows/build_artifacts.yml diff --git a/.github/deploy/build_aarch64-apple-darwin.sh b/.github/deploy/build_aarch64-apple-darwin.sh deleted file mode 100644 index 671b016..0000000 --- a/.github/deploy/build_aarch64-apple-darwin.sh +++ /dev/null @@ -1,51 +0,0 @@ -#!/bin/bash -## Build script for cross-compiling kbo for aarch64-apple-darwin. -## Run this inside https://github.com/shepherdjerred/macos-cross-compiler - -set -exo pipefail - -VER=$1 -if [[ -z $VER ]]; then - echo "Error: specify version" - exit; -fi - -rustup default stable - -mkdir /io/tmp -cd /io/tmp - -# Extract and enter source -git clone https://github.com/tmaklin/sablast.git -cd sablast -git checkout ${VER} - -mkdir -p .cargo -# Rust toolchain -rustup target add aarch64-apple-darwin - -echo "[build]" >> .cargo/config.toml -echo "target = \"aarch64-apple-darwin\"" >> .cargo/config.toml -echo "[target.aarch64-apple-darwin]" >> .cargo/config.toml -echo "linker = \"aarch64-apple-darwin22-gcc\"" >> .cargo/config.toml - -export CC="aarch64-apple-darwin22-gcc" -export CXX="aarch64-apple-darwin22-g++" - -RUSTFLAGS='-L /osxcross/SDK/MacOSX13.0.sdk/usr/lib' cargo build --all-features --release --target aarch64-apple-darwin - -## gather the stuff to distribute -target=kbo-candidate-aarch64-apple-darwin -path=/io/tmp/$target -mkdir $path -cp target/aarch64-apple-darwin/release/kbo $path/ -cp README.md $path/ -cp COPYRIGHT $path/ -cp LICENSE-APACHE $path/ -cp LICENSE-MIT $path/ -cd /io/tmp -tar -zcvf $target.tar.gz $target -sha256sum $target.tar.gz > $target".tar.gz.sha256sum" -mv $target.tar.gz /io/ -mv $target".tar.gz.sha256sum" /io/ -cd /io/ diff --git a/.github/deploy/build_x86_64-apple-darwin.sh b/.github/deploy/build_x86_64-apple-darwin.sh deleted file mode 100644 index f4056e4..0000000 --- a/.github/deploy/build_x86_64-apple-darwin.sh +++ /dev/null @@ -1,51 +0,0 @@ -#!/bin/bash -## Build script for cross-compiling kbo for aarch64-apple-darwin. -## Run this inside https://github.com/shepherdjerred/macos-cross-compiler - -set -exo pipefail - -VER=$1 -if [[ -z $VER ]]; then - echo "Error: specify version" - exit; -fi - -rustup default stable - -mkdir /io/tmp -cd /io/tmp - -# Extract and enter source -git clone https://github.com/tmaklin/sablast.git -cd sablast -git checkout ${VER} - -mkdir -p .cargo -# Rust toolchain -rustup target add x86_64-apple-darwin - -echo "[build]" >> .cargo/config.toml -echo "target = \"x86_64-apple-darwin\"" >> .cargo/config.toml -echo "[target.x86_64-apple-darwin]" >> .cargo/config.toml -echo "linker = \"x86_64-apple-darwin22-gcc\"" >> .cargo/config.toml - -export CC="x86_64-apple-darwin22-gcc" -export CXX="x86_64-apple-darwin22-g++" - -RUSTFLAGS='-L /osxcross/SDK/MacOSX13.0.sdk/usr/lib' cargo build --all-features --release --target x86_64-apple-darwin - -## gather the stuff to distribute -target=kbo-candidate-x86_64-apple-darwin -path=/io/tmp/$target -mkdir $path -cp target/x86_64-apple-darwin/release/kbo $path/ -cp README.md $path/ -cp COPYRIGHT $path/ -cp LICENSE-APACHE $path/ -cp LICENSE-MIT $path/ -cd /io/tmp -tar -zcvf $target.tar.gz $target -sha256sum $target.tar.gz > $target".tar.gz.sha256sum" -mv $target.tar.gz /io/ -mv $target".tar.gz.sha256sum" /io/ -cd /io/ diff --git a/.github/workflows/build_and_test.yml b/.github/workflows/build_and_test.yml index 63b3a35..c27b3a7 100644 --- a/.github/workflows/build_and_test.yml +++ b/.github/workflows/build_and_test.yml @@ -25,7 +25,7 @@ jobs: run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }} - name: Build binary - run: cargo build --features cli --verbose + run: cargo build --all-features --verbose - name: Run unit and integration tests - run: cargo test --no-fail-fast --verbose + run: cargo test --all-features --no-fail-fast --verbose diff --git a/.github/workflows/build_artifacts.yml b/.github/workflows/build_artifacts.yml deleted file mode 100644 index 39c1a88..0000000 --- a/.github/workflows/build_artifacts.yml +++ /dev/null @@ -1,99 +0,0 @@ -name: Build artifacts for release - -on: - pull_request: - branches: [main] - -jobs: - build_linux-x86_64: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - name: Compile - id: compile - uses: rust-build/rust-build.action@v1.4.5 - with: - ARCHIVE_TYPES: tar.gz - ARCHIVE_NAME: kbo-candidate-x86_64-unknown-linux-musl - RUSTTARGET: x86_64-unknown-linux-musl - EXTRA_FEATURES: "cli" - EXTRA_FILES: "COPYRIGHT LICENSE-APACHE LICENSE-MIT README.md" - TOOLCHAIN_VERSION: stable-2024-09-05 - UPLOAD_MODE: none - - - name: Upload x86_64-unknown-linux-musl - uses: actions/upload-artifact@v4 - with: - name: kbo-candidate-x86_64-unknown-linux-musl - path: | - ${{ steps.compile.outputs.BUILT_ARCHIVE }} - ${{ steps.compile.outputs.BUILT_CHECKSUM }} - - build_macOS-x86_64: - runs-on: ubuntu-latest - container: ghcr.io/shepherdjerred/macos-cross-compiler:latest - steps: - - name: Install wget and git - id: install-wget - run: apt-get update && apt install -y wget git - - - name: Create io directory - id: mkdir-io - run: mkdir /io && cd /io - - - name: Download build script - id: dl-build-script - run: wget https://raw.githubusercontent.com/${{ github.repository }}/${{ github.head_ref }}/.github/deploy/build_x86_64-apple-darwin.sh - - - name: Compile in macOS Cross Compiler container - id: compile-in-container - run: chmod +x build_x86_64-apple-darwin.sh && ./build_x86_64-apple-darwin.sh ${{ github.head_ref }} arm64 - - - name: Upload x86_64-apple-darwin - if: success() - uses: actions/upload-artifact@v4 - with: - name: kbo-candidate-x86_64-apple-darwin - path: /io/kbo-candidate-x86_64-apple-darwin.tar.gz - - - name: Upload x86_64-apple-darwin sha256sum - if: success() - uses: actions/upload-artifact@v4 - with: - name: kbo-candidate-x86_64-apple-darwin-sha256sum - path: /io/kbo-candidate-x86_64-apple-darwin.tar.gz.sha256sum - - build_macOS-aarch64: - runs-on: ubuntu-latest - container: ghcr.io/shepherdjerred/macos-cross-compiler:latest - steps: - - name: Install wget and git - id: install-wget - run: apt-get update && apt install -y wget git - - - name: Create io directory - id: mkdir-io - run: mkdir /io && cd /io - - - name: Download build script - id: dl-build-script - run: wget https://raw.githubusercontent.com/${{ github.repository }}/${{ github.head_ref }}/.github/deploy/build_aarch64-apple-darwin.sh - - - name: Compile in macOS Cross Compiler container - id: compile-in-container - run: chmod +x build_aarch64-apple-darwin.sh && ./build_aarch64-apple-darwin.sh ${{ github.head_ref }} - - - name: Upload aarch64-apple-darwin - if: success() - uses: actions/upload-artifact@v4 - with: - name: kbo-candidate-aarch64-apple-darwin - path: /io/kbo-candidate-aarch64-apple-darwin.tar.gz - - - name: Upload aarch64-apple-darwin sha256sum - if: success() - uses: actions/upload-artifact@v4 - with: - name: kbo-candidate-aarch64-apple-darwin-sha256sum - path: /io/kbo-candidate-aarch64-apple-darwin.tar.gz.sha256sum diff --git a/.github/workflows/make_release.yml b/.github/workflows/make_release.yml index c27efb1..5c8558c 100644 --- a/.github/workflows/make_release.yml +++ b/.github/workflows/make_release.yml @@ -15,32 +15,6 @@ jobs: environment: Make kbo release steps: - - name: Download artifacts - uses: dawidd6/action-download-artifact@v6 - with: - workflow: build_artifacts.yml - workflow_conclusion: success - - - name: Organise files - shell: bash - run: | - mv kbo-candidate-x86_64-unknown-linux-musl/kbo-candidate-x86_64-unknown-linux-musl.tar.gz ./ - mv kbo-candidate-x86_64-apple-darwin/kbo-candidate-x86_64-apple-darwin.tar.gz ./ - mv kbo-candidate-aarch64-apple-darwin/kbo-candidate-aarch64-apple-darwin.tar.gz ./ - - - name: Rename mac artifacts - shell: bash - run: | - tar -zxvf kbo-candidate-x86_64-apple-darwin.tar.gz && mv kbo-candidate-x86_64-apple-darwin kbo-${{ github.ref_name }}-x86_64-apple-darwin && tar -zcvf kbo-candidate-x86_64-apple-darwin.tar.gz kbo-${{ github.ref_name }}-x86_64-apple-darwin - tar -zxvf kbo-candidate-aarch64-apple-darwin.tar.gz && mv kbo-candidate-aarch64-apple-darwin kbo-${{ github.ref_name }}-aarch64-apple-darwin && tar -zcvf kbo-candidate-aarch64-apple-darwin.tar.gz kbo-${{ github.ref_name }}-aarch64-apple-darwin - - - name: Designate version - shell: bash - run: | - mv kbo-candidate-x86_64-unknown-linux-musl.tar.gz kbo-${{ github.ref_name }}-x86_64-linux-musl.tar.gz - mv kbo-candidate-x86_64-apple-darwin.tar.gz kbo-${{ github.ref_name }}-x86_64-apple-darwin.tar.gz - mv kbo-candidate-aarch64-apple-darwin.tar.gz kbo-${{ github.ref_name }}-aarch64-apple-darwin.tar.gz - - name: Get current date id: date run: echo "::set-output name=date::$(date +'%d %B %Y')" @@ -54,7 +28,3 @@ jobs: prerelease: false fail_on_unmatched_files: true generate_release_notes: true - files: | - kbo-${{ github.ref_name }}-x86_64-linux-musl.tar.gz - kbo-${{ github.ref_name }}-x86_64-apple-darwin.tar.gz - kbo-${{ github.ref_name }}-aarch64-apple-darwin.tar.gz \ No newline at end of file