From 3005fe9935ad294fe4d09cefe9859207977988bf Mon Sep 17 00:00:00 2001 From: Mic Neale Date: Wed, 18 Dec 2024 15:24:54 +1100 Subject: [PATCH 01/18] tidy up --- .github/workflows/cli-release.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/cli-release.yml b/.github/workflows/cli-release.yml index 967ca2440356..e10e9c057940 100644 --- a/.github/workflows/cli-release.yml +++ b/.github/workflows/cli-release.yml @@ -1,7 +1,7 @@ on: push: tags: - - "v1.*" + - "v00.*" workflow_dispatch: concurrency: group: ${{ github.workflow }} @@ -13,10 +13,10 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-latest, macos-latest] + os: [ubuntu-22.04, macos-latest] architecture: [x86_64, aarch64] include: - - os: ubuntu-latest + - os: ubuntu-22.04 suffix: unknown-linux-gnu - os: macos-latest suffix: apple-darwin @@ -27,15 +27,15 @@ jobs: with: target: ${{ matrix.architecture }}-${{ matrix.suffix }} - name: Install cross-compilation tools and dependencies - if: matrix.os == 'ubuntu-latest' + if: matrix.os == 'ubuntu-22.04' run: | + if [ "${{ matrix.architecture }}" = "aarch64" ]; then + sudo dpkg --add-architecture arm64 + fi sudo apt-get update sudo apt-get install -y pkg-config libssl-dev if [ "${{ matrix.architecture }}" = "aarch64" ]; then - sudo dpkg --add-architecture arm64 - sudo apt-get update - sudo apt-get install -y gcc-aarch64-linux-gnu - sudo apt-get install -y libssl-dev:arm64 libc6-dev-arm64-cross + sudo apt-get install -y gcc-aarch64-linux-gnu libssl-dev:arm64 libc6-dev-arm64-cross fi - id: build shell: bash From bb58aa7c7fc4dbfefe19d4dc287a39bab20d3e14 Mon Sep 17 00:00:00 2001 From: Mic Neale Date: Wed, 18 Dec 2024 15:35:39 +1100 Subject: [PATCH 02/18] trying another approach --- .github/workflows/cli-release.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/cli-release.yml b/.github/workflows/cli-release.yml index e10e9c057940..ecdb98e75a73 100644 --- a/.github/workflows/cli-release.yml +++ b/.github/workflows/cli-release.yml @@ -13,10 +13,10 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-22.04, macos-latest] + os: [ubuntu-latest, macos-latest] architecture: [x86_64, aarch64] include: - - os: ubuntu-22.04 + - os: ubuntu-latest suffix: unknown-linux-gnu - os: macos-latest suffix: apple-darwin @@ -27,12 +27,12 @@ jobs: with: target: ${{ matrix.architecture }}-${{ matrix.suffix }} - name: Install cross-compilation tools and dependencies - if: matrix.os == 'ubuntu-22.04' + if: matrix.os == 'ubuntu-latest' run: | if [ "${{ matrix.architecture }}" = "aarch64" ]; then sudo dpkg --add-architecture arm64 fi - sudo apt-get update + sudo apt update sudo apt-get install -y pkg-config libssl-dev if [ "${{ matrix.architecture }}" = "aarch64" ]; then sudo apt-get install -y gcc-aarch64-linux-gnu libssl-dev:arm64 libc6-dev-arm64-cross From aa8be0956758f0790a62b27a0028409d3a3a4dbe Mon Sep 17 00:00:00 2001 From: Mic Neale Date: Wed, 18 Dec 2024 15:46:05 +1100 Subject: [PATCH 03/18] trying new approach --- .github/workflows/cli-release.yml | 63 ++++++++++++++++++++----------- 1 file changed, 40 insertions(+), 23 deletions(-) diff --git a/.github/workflows/cli-release.yml b/.github/workflows/cli-release.yml index ecdb98e75a73..4a723092192e 100644 --- a/.github/workflows/cli-release.yml +++ b/.github/workflows/cli-release.yml @@ -3,10 +3,13 @@ on: tags: - "v00.*" workflow_dispatch: + concurrency: group: ${{ github.workflow }} cancel-in-progress: true + name: Release CLI + jobs: build: name: Build ${{ matrix.os }}-${{ matrix.architecture }} @@ -20,48 +23,62 @@ jobs: suffix: unknown-linux-gnu - os: macos-latest suffix: apple-darwin + steps: - - uses: actions/checkout@v4 - - name: Set up Rust - uses: actions-rust-lang/setup-rust-toolchain@v1 + - name: Checkout code + uses: actions/checkout@v3 + + - name: Set up Rust toolchain + uses: actions-rs/toolchain@v1 with: + toolchain: stable target: ${{ matrix.architecture }}-${{ matrix.suffix }} - - name: Install cross-compilation tools and dependencies + override: true + + - name: Install dependencies for Linux if: matrix.os == 'ubuntu-latest' run: | - if [ "${{ matrix.architecture }}" = "aarch64" ]; then - sudo dpkg --add-architecture arm64 - fi - sudo apt update + sudo apt-get update sudo apt-get install -y pkg-config libssl-dev - if [ "${{ matrix.architecture }}" = "aarch64" ]; then + if [ "${{ matrix.architecture }}" == "aarch64" ]; then + sudo dpkg --add-architecture arm64 + sudo apt-get update sudo apt-get install -y gcc-aarch64-linux-gnu libssl-dev:arm64 libc6-dev-arm64-cross fi - - id: build + + - name: Build the project shell: bash run: | export TARGET=${{ matrix.architecture }}-${{ matrix.suffix }} cargo build --release --target $TARGET - cd target/${TARGET}/release - tar -cjf goose-${TARGET}.tar.bz2 goose goosed - export TARGET_PATH="target/${TARGET}/release/goose-${TARGET}.tar.bz2" - echo "TARGET_PATH=${TARGET_PATH}" >> $GITHUB_OUTPUT - - uses: actions/upload-artifact@v4 + mkdir -p dist + cp target/${TARGET}/release/goose dist/ + cp target/${TARGET}/release/goosed dist/ + tar -cjf dist/goose-${TARGET}.tar.bz2 -C dist goose goosed + echo "dist/goose-${TARGET}.tar.bz2" >> $GITHUB_ENV + + - name: Upload artifact + uses: actions/upload-artifact@v3 with: name: goose-${{ matrix.architecture }}-${{ matrix.suffix }} - path: ${{ steps.build.outputs.TARGET_PATH }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + path: dist/goose-${{ matrix.architecture }}-${{ matrix.suffix }}.tar.bz2 + release: name: Release runs-on: ubuntu-latest - needs: [build] + needs: build permissions: contents: write steps: - - uses: actions/download-artifact@v4 + - name: Download build artifacts + uses: actions/download-artifact@v3 with: - merge-multiple: true - - uses: ncipollo/release-action@v1 + merge: true + + - name: Publish Release + uses: ncipollo/release-action@v1 with: - artifacts: "goose-*.bz2" + artifacts: "goose-*.tar.bz2" + token: ${{ secrets.GITHUB_TOKEN }} + draft: true + prerelease: true From cf95ab0d5851b407abc1df43b592f64b59372450 Mon Sep 17 00:00:00 2001 From: Mic Neale Date: Wed, 18 Dec 2024 15:49:45 +1100 Subject: [PATCH 04/18] trying to fix --- .github/workflows/cli-release.yml | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/.github/workflows/cli-release.yml b/.github/workflows/cli-release.yml index 4a723092192e..12d27d01a5b9 100644 --- a/.github/workflows/cli-release.yml +++ b/.github/workflows/cli-release.yml @@ -28,6 +28,17 @@ jobs: - name: Checkout code uses: actions/checkout@v3 + - name: Debug Ubuntu version + if: matrix.os == 'ubuntu-latest' + run: cat /etc/os-release + + - name: Clean APT sources and update + if: matrix.os == 'ubuntu-latest' + run: | + sudo rm -rf /var/lib/apt/lists/* + sudo sed -i 's/noble/jammy/g' /etc/apt/sources.list + sudo apt-get update + - name: Set up Rust toolchain uses: actions-rs/toolchain@v1 with: @@ -38,11 +49,10 @@ jobs: - name: Install dependencies for Linux if: matrix.os == 'ubuntu-latest' run: | + sudo dpkg --add-architecture arm64 sudo apt-get update sudo apt-get install -y pkg-config libssl-dev if [ "${{ matrix.architecture }}" == "aarch64" ]; then - sudo dpkg --add-architecture arm64 - sudo apt-get update sudo apt-get install -y gcc-aarch64-linux-gnu libssl-dev:arm64 libc6-dev-arm64-cross fi @@ -80,5 +90,5 @@ jobs: with: artifacts: "goose-*.tar.bz2" token: ${{ secrets.GITHUB_TOKEN }} - draft: true - prerelease: true + draft: false + prerelease: false From 8a5082abead57e40f51b535a52b3071ff68cd921 Mon Sep 17 00:00:00 2001 From: Mic Neale Date: Wed, 18 Dec 2024 15:52:33 +1100 Subject: [PATCH 05/18] not sure what is going on with actions --- .github/workflows/cli-release.yml | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/.github/workflows/cli-release.yml b/.github/workflows/cli-release.yml index 12d27d01a5b9..0ff248f9b0ec 100644 --- a/.github/workflows/cli-release.yml +++ b/.github/workflows/cli-release.yml @@ -16,10 +16,10 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-latest, macos-latest] + os: [ubuntu-22.04, macos-latest] # Explicitly set Ubuntu version architecture: [x86_64, aarch64] include: - - os: ubuntu-latest + - os: ubuntu-22.04 suffix: unknown-linux-gnu - os: macos-latest suffix: apple-darwin @@ -28,17 +28,6 @@ jobs: - name: Checkout code uses: actions/checkout@v3 - - name: Debug Ubuntu version - if: matrix.os == 'ubuntu-latest' - run: cat /etc/os-release - - - name: Clean APT sources and update - if: matrix.os == 'ubuntu-latest' - run: | - sudo rm -rf /var/lib/apt/lists/* - sudo sed -i 's/noble/jammy/g' /etc/apt/sources.list - sudo apt-get update - - name: Set up Rust toolchain uses: actions-rs/toolchain@v1 with: @@ -47,7 +36,7 @@ jobs: override: true - name: Install dependencies for Linux - if: matrix.os == 'ubuntu-latest' + if: matrix.os == 'ubuntu-22.04' run: | sudo dpkg --add-architecture arm64 sudo apt-get update @@ -75,7 +64,7 @@ jobs: release: name: Release - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 # Explicitly set Ubuntu version needs: build permissions: contents: write From 5ebb8530de8cfbbb13897d73c18e4b7c630a5c23 Mon Sep 17 00:00:00 2001 From: Mic Neale Date: Wed, 18 Dec 2024 16:02:22 +1100 Subject: [PATCH 06/18] trying original --- .github/workflows/cli-release.yml | 69 ++++++++++--------------------- 1 file changed, 21 insertions(+), 48 deletions(-) diff --git a/.github/workflows/cli-release.yml b/.github/workflows/cli-release.yml index 0ff248f9b0ec..2d44b9571847 100644 --- a/.github/workflows/cli-release.yml +++ b/.github/workflows/cli-release.yml @@ -1,83 +1,56 @@ on: push: tags: - - "v00.*" + - "v1.*" workflow_dispatch: - concurrency: group: ${{ github.workflow }} cancel-in-progress: true - name: Release CLI - jobs: build: name: Build ${{ matrix.os }}-${{ matrix.architecture }} runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-22.04, macos-latest] # Explicitly set Ubuntu version + os: [ubuntu-latest, macos-latest] architecture: [x86_64, aarch64] include: - - os: ubuntu-22.04 + - os: ubuntu-latest suffix: unknown-linux-gnu - os: macos-latest suffix: apple-darwin - steps: - - name: Checkout code - uses: actions/checkout@v3 - - - name: Set up Rust toolchain - uses: actions-rs/toolchain@v1 + - uses: actions/checkout@v4 + - name: Set up Rust + uses: actions-rust-lang/setup-rust-toolchain@v1 with: - toolchain: stable target: ${{ matrix.architecture }}-${{ matrix.suffix }} - override: true - - - name: Install dependencies for Linux - if: matrix.os == 'ubuntu-22.04' - run: | - sudo dpkg --add-architecture arm64 - sudo apt-get update - sudo apt-get install -y pkg-config libssl-dev - if [ "${{ matrix.architecture }}" == "aarch64" ]; then - sudo apt-get install -y gcc-aarch64-linux-gnu libssl-dev:arm64 libc6-dev-arm64-cross - fi - - - name: Build the project + - id: build shell: bash run: | export TARGET=${{ matrix.architecture }}-${{ matrix.suffix }} cargo build --release --target $TARGET - mkdir -p dist - cp target/${TARGET}/release/goose dist/ - cp target/${TARGET}/release/goosed dist/ - tar -cjf dist/goose-${TARGET}.tar.bz2 -C dist goose goosed - echo "dist/goose-${TARGET}.tar.bz2" >> $GITHUB_ENV - - - name: Upload artifact - uses: actions/upload-artifact@v3 + cd target/${TARGET}/release + tar -cjf goose-${TARGET}.tar.bz2 goose goosed + export TARGET_PATH="target/${TARGET}/release/goose-${TARGET}.tar.bz2" + echo "TARGET_PATH=${TARGET_PATH}" >> $GITHUB_OUTPUT + - uses: actions/upload-artifact@v4 with: name: goose-${{ matrix.architecture }}-${{ matrix.suffix }} - path: dist/goose-${{ matrix.architecture }}-${{ matrix.suffix }}.tar.bz2 - + path: ${{ steps.build.outputs.TARGET_PATH }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} release: name: Release - runs-on: ubuntu-22.04 # Explicitly set Ubuntu version - needs: build + runs-on: ubuntu-latest + needs: [build] permissions: contents: write steps: - - name: Download build artifacts - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: - merge: true - - - name: Publish Release - uses: ncipollo/release-action@v1 + merge-multiple: true + - uses: ncipollo/release-action@v1 with: - artifacts: "goose-*.tar.bz2" - token: ${{ secrets.GITHUB_TOKEN }} - draft: false - prerelease: false + artifacts: "goose-*.bz2" \ No newline at end of file From 9b1f29fc55746398b481b60e749961b69f7c526d Mon Sep 17 00:00:00 2001 From: Mic Neale Date: Wed, 18 Dec 2024 16:02:45 +1100 Subject: [PATCH 07/18] temp tag --- .github/workflows/cli-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cli-release.yml b/.github/workflows/cli-release.yml index 2d44b9571847..92d9d7037705 100644 --- a/.github/workflows/cli-release.yml +++ b/.github/workflows/cli-release.yml @@ -1,7 +1,7 @@ on: push: tags: - - "v1.*" + - "v00.*" workflow_dispatch: concurrency: group: ${{ github.workflow }} From 2869bec480a9e546c2739498d70729c60fb8ffd3 Mon Sep 17 00:00:00 2001 From: Mic Neale Date: Wed, 18 Dec 2024 16:08:07 +1100 Subject: [PATCH 08/18] adding deps --- .github/workflows/cli-release.yml | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cli-release.yml b/.github/workflows/cli-release.yml index 92d9d7037705..e6005b43e77d 100644 --- a/.github/workflows/cli-release.yml +++ b/.github/workflows/cli-release.yml @@ -3,10 +3,13 @@ on: tags: - "v00.*" workflow_dispatch: + concurrency: group: ${{ github.workflow }} cancel-in-progress: true + name: Release CLI + jobs: build: name: Build ${{ matrix.os }}-${{ matrix.architecture }} @@ -22,10 +25,22 @@ jobs: suffix: apple-darwin steps: - uses: actions/checkout@v4 + - name: Set up Rust uses: actions-rust-lang/setup-rust-toolchain@v1 with: target: ${{ matrix.architecture }}-${{ matrix.suffix }} + + - name: Add Rust target for cross-compilation + if: matrix.architecture == 'aarch64' + run: rustup target add aarch64-unknown-linux-gnu + + - name: Install dependencies for cross-compilation + if: matrix.architecture == 'aarch64' && matrix.os == 'ubuntu-latest' + run: | + sudo apt-get update + sudo apt-get install -y gcc-aarch64-linux-gnu + - id: build shell: bash run: | @@ -35,12 +50,14 @@ jobs: tar -cjf goose-${TARGET}.tar.bz2 goose goosed export TARGET_PATH="target/${TARGET}/release/goose-${TARGET}.tar.bz2" echo "TARGET_PATH=${TARGET_PATH}" >> $GITHUB_OUTPUT + - uses: actions/upload-artifact@v4 with: name: goose-${{ matrix.architecture }}-${{ matrix.suffix }} path: ${{ steps.build.outputs.TARGET_PATH }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + release: name: Release runs-on: ubuntu-latest @@ -51,6 +68,8 @@ jobs: - uses: actions/download-artifact@v4 with: merge-multiple: true + - uses: ncipollo/release-action@v1 with: - artifacts: "goose-*.bz2" \ No newline at end of file + artifacts: "goose-*.bz2" + token: ${{ secrets.GITHUB_TOKEN }} From 1f3898c1771fcaa98c271a9844eb30a970689356 Mon Sep 17 00:00:00 2001 From: Mic Neale Date: Wed, 18 Dec 2024 16:14:53 +1100 Subject: [PATCH 09/18] use cross --- .github/workflows/cli-release.yml | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/.github/workflows/cli-release.yml b/.github/workflows/cli-release.yml index e6005b43e77d..ee1ad1aea0a0 100644 --- a/.github/workflows/cli-release.yml +++ b/.github/workflows/cli-release.yml @@ -26,26 +26,21 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Set up Rust + - name: Install Rust uses: actions-rust-lang/setup-rust-toolchain@v1 - with: - target: ${{ matrix.architecture }}-${{ matrix.suffix }} - - name: Add Rust target for cross-compilation - if: matrix.architecture == 'aarch64' - run: rustup target add aarch64-unknown-linux-gnu + - name: Install Cross + run: cargo install cross - - name: Install dependencies for cross-compilation - if: matrix.architecture == 'aarch64' && matrix.os == 'ubuntu-latest' + - name: Add Rust target for cross-compilation run: | - sudo apt-get update - sudo apt-get install -y gcc-aarch64-linux-gnu + rustup target add ${{ matrix.architecture }}-${{ matrix.suffix }} - id: build shell: bash run: | export TARGET=${{ matrix.architecture }}-${{ matrix.suffix }} - cargo build --release --target $TARGET + cross build --release --target $TARGET cd target/${TARGET}/release tar -cjf goose-${TARGET}.tar.bz2 goose goosed export TARGET_PATH="target/${TARGET}/release/goose-${TARGET}.tar.bz2" @@ -55,8 +50,6 @@ jobs: with: name: goose-${{ matrix.architecture }}-${{ matrix.suffix }} path: ${{ steps.build.outputs.TARGET_PATH }} - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} release: name: Release From 851e632840b7b6b291e57352d19a7b5109f044fd Mon Sep 17 00:00:00 2001 From: Mic Neale Date: Wed, 18 Dec 2024 16:21:58 +1100 Subject: [PATCH 10/18] simplify --- .github/workflows/cli-release.yml | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/workflows/cli-release.yml b/.github/workflows/cli-release.yml index ee1ad1aea0a0..979526d434bc 100644 --- a/.github/workflows/cli-release.yml +++ b/.github/workflows/cli-release.yml @@ -26,21 +26,24 @@ jobs: steps: - uses: actions/checkout@v4 - - name: Install Rust + - name: Set up Rust uses: actions-rust-lang/setup-rust-toolchain@v1 + with: + target: ${{ matrix.architecture }}-${{ matrix.suffix }} - - name: Install Cross + - name: Install Cross (Ubuntu only) + if: matrix.os == 'ubuntu-latest' run: cargo install cross - - name: Add Rust target for cross-compilation - run: | - rustup target add ${{ matrix.architecture }}-${{ matrix.suffix }} - - id: build shell: bash run: | export TARGET=${{ matrix.architecture }}-${{ matrix.suffix }} - cross build --release --target $TARGET + if [ "${{ matrix.os }}" == "ubuntu-latest" ]; then + cross build --release --target $TARGET + else + cargo build --release --target $TARGET + fi cd target/${TARGET}/release tar -cjf goose-${TARGET}.tar.bz2 goose goosed export TARGET_PATH="target/${TARGET}/release/goose-${TARGET}.tar.bz2" From 06f9b08133846c05ba68526df12c36408a8bf316 Mon Sep 17 00:00:00 2001 From: Mic Neale Date: Wed, 18 Dec 2024 16:29:56 +1100 Subject: [PATCH 11/18] ubuntu fixes --- .github/workflows/cli-release.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/cli-release.yml b/.github/workflows/cli-release.yml index 979526d434bc..273a4719b9f8 100644 --- a/.github/workflows/cli-release.yml +++ b/.github/workflows/cli-release.yml @@ -31,6 +31,20 @@ jobs: with: target: ${{ matrix.architecture }}-${{ matrix.suffix }} + - name: Install dependencies for cross-compilation (Ubuntu only) + if: matrix.architecture == 'aarch64' && matrix.os == 'ubuntu-latest' + run: | + sudo apt-get update + sudo apt-get install -y libssl-dev gcc-aarch64-linux-gnu + + - name: Configure OpenSSL for cross-compilation (Ubuntu only) + if: matrix.architecture == 'aarch64' && matrix.os == 'ubuntu-latest' + run: | + export OPENSSL_DIR=/usr/lib/aarch64-linux-gnu + export PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig + echo "OPENSSL_DIR=${OPENSSL_DIR}" >> $GITHUB_ENV + echo "PKG_CONFIG_PATH=${PKG_CONFIG_PATH}" >> $GITHUB_ENV + - name: Install Cross (Ubuntu only) if: matrix.os == 'ubuntu-latest' run: cargo install cross From eb2f234a0c0a8e57428b0c58db523babe4d90766 Mon Sep 17 00:00:00 2001 From: Mic Neale Date: Wed, 18 Dec 2024 16:34:36 +1100 Subject: [PATCH 12/18] try again --- .github/workflows/cli-release.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cli-release.yml b/.github/workflows/cli-release.yml index 273a4719b9f8..0b44e0de7824 100644 --- a/.github/workflows/cli-release.yml +++ b/.github/workflows/cli-release.yml @@ -31,13 +31,17 @@ jobs: with: target: ${{ matrix.architecture }}-${{ matrix.suffix }} - - name: Install dependencies for cross-compilation (Ubuntu only) + - name: Install cross-compilation dependencies if: matrix.architecture == 'aarch64' && matrix.os == 'ubuntu-latest' run: | + sudo dpkg --add-architecture arm64 sudo apt-get update - sudo apt-get install -y libssl-dev gcc-aarch64-linux-gnu + sudo apt-get install -y \ + libssl-dev:arm64 \ + gcc-aarch64-linux-gnu \ + pkg-config - - name: Configure OpenSSL for cross-compilation (Ubuntu only) + - name: Configure OpenSSL for cross-compilation if: matrix.architecture == 'aarch64' && matrix.os == 'ubuntu-latest' run: | export OPENSSL_DIR=/usr/lib/aarch64-linux-gnu From 224e2952b51e74e382d4eae3f8d82e77fa72342e Mon Sep 17 00:00:00 2001 From: Mic Neale Date: Wed, 18 Dec 2024 16:43:43 +1100 Subject: [PATCH 13/18] build for arm on macos runners only --- .github/workflows/cli-release.yml | 46 ++++++++++++------------------- 1 file changed, 18 insertions(+), 28 deletions(-) diff --git a/.github/workflows/cli-release.yml b/.github/workflows/cli-release.yml index 0b44e0de7824..66429a3d1c91 100644 --- a/.github/workflows/cli-release.yml +++ b/.github/workflows/cli-release.yml @@ -19,10 +19,14 @@ jobs: os: [ubuntu-latest, macos-latest] architecture: [x86_64, aarch64] include: + # Build on Ubuntu only for x86_64 - os: ubuntu-latest + architecture: x86_64 suffix: unknown-linux-gnu + # Cross-compile on macOS for aarch64 - os: macos-latest - suffix: apple-darwin + architecture: aarch64 + suffix: unknown-linux-gnu steps: - uses: actions/checkout@v4 @@ -31,46 +35,32 @@ jobs: with: target: ${{ matrix.architecture }}-${{ matrix.suffix }} - - name: Install cross-compilation dependencies - if: matrix.architecture == 'aarch64' && matrix.os == 'ubuntu-latest' + # Install dependencies and set up for macOS cross-compilation + - name: Install dependencies (macOS only) + if: matrix.os == 'macos-latest' && matrix.architecture == 'aarch64' run: | - sudo dpkg --add-architecture arm64 - sudo apt-get update - sudo apt-get install -y \ - libssl-dev:arm64 \ - gcc-aarch64-linux-gnu \ - pkg-config + brew install llvm + rustup target add aarch64-unknown-linux-gnu + echo "export PATH=$(brew --prefix llvm)/bin:\$PATH" >> $GITHUB_ENV - - name: Configure OpenSSL for cross-compilation - if: matrix.architecture == 'aarch64' && matrix.os == 'ubuntu-latest' - run: | - export OPENSSL_DIR=/usr/lib/aarch64-linux-gnu - export PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig - echo "OPENSSL_DIR=${OPENSSL_DIR}" >> $GITHUB_ENV - echo "PKG_CONFIG_PATH=${PKG_CONFIG_PATH}" >> $GITHUB_ENV - - - name: Install Cross (Ubuntu only) - if: matrix.os == 'ubuntu-latest' - run: cargo install cross - - - id: build - shell: bash + - name: Build run: | export TARGET=${{ matrix.architecture }}-${{ matrix.suffix }} - if [ "${{ matrix.os }}" == "ubuntu-latest" ]; then - cross build --release --target $TARGET + if [ "${{ matrix.os }}" == "macos-latest" ] && [ "${{ matrix.architecture }}" == "aarch64" ]; then + CC=aarch64-linux-gnu-gcc \ + CXX=aarch64-linux-gnu-g++ \ + cargo build --release --target $TARGET else cargo build --release --target $TARGET fi cd target/${TARGET}/release tar -cjf goose-${TARGET}.tar.bz2 goose goosed - export TARGET_PATH="target/${TARGET}/release/goose-${TARGET}.tar.bz2" - echo "TARGET_PATH=${TARGET_PATH}" >> $GITHUB_OUTPUT + echo "goose-${TARGET}.tar.bz2" >> $GITHUB_ENV - uses: actions/upload-artifact@v4 with: name: goose-${{ matrix.architecture }}-${{ matrix.suffix }} - path: ${{ steps.build.outputs.TARGET_PATH }} + path: target/${{ matrix.architecture }}-${{ matrix.suffix }}/release/goose-*.tar.bz2 release: name: Release From 3acc126bd4b7a659eb7da24ccefbc9f6cc85199a Mon Sep 17 00:00:00 2001 From: Mic Neale Date: Wed, 18 Dec 2024 16:47:47 +1100 Subject: [PATCH 14/18] simplify junk --- .github/workflows/cli-release.yml | 45 ++++++++++--------------------- 1 file changed, 14 insertions(+), 31 deletions(-) diff --git a/.github/workflows/cli-release.yml b/.github/workflows/cli-release.yml index 66429a3d1c91..ee8fad103a86 100644 --- a/.github/workflows/cli-release.yml +++ b/.github/workflows/cli-release.yml @@ -1,14 +1,14 @@ on: push: tags: - - "v00.*" + - "v*" workflow_dispatch: concurrency: group: ${{ github.workflow }} cancel-in-progress: true -name: Release CLI +name: Build CLI jobs: build: @@ -19,61 +19,44 @@ jobs: os: [ubuntu-latest, macos-latest] architecture: [x86_64, aarch64] include: - # Build on Ubuntu only for x86_64 - os: ubuntu-latest architecture: x86_64 suffix: unknown-linux-gnu - # Cross-compile on macOS for aarch64 + - os: macos-latest + architecture: x86_64 + suffix: apple-darwin - os: macos-latest architecture: aarch64 - suffix: unknown-linux-gnu + suffix: apple-darwin steps: + # Step 1: Checkout code - uses: actions/checkout@v4 + # Step 2: Set up Rust toolchain - name: Set up Rust uses: actions-rust-lang/setup-rust-toolchain@v1 with: target: ${{ matrix.architecture }}-${{ matrix.suffix }} - # Install dependencies and set up for macOS cross-compilation - - name: Install dependencies (macOS only) + # Step 3: Install dependencies (macOS ARM only) + - name: Install dependencies for macOS ARM if: matrix.os == 'macos-latest' && matrix.architecture == 'aarch64' run: | brew install llvm - rustup target add aarch64-unknown-linux-gnu + rustup target add aarch64-apple-darwin echo "export PATH=$(brew --prefix llvm)/bin:\$PATH" >> $GITHUB_ENV + # Step 4: Build the project - name: Build run: | export TARGET=${{ matrix.architecture }}-${{ matrix.suffix }} - if [ "${{ matrix.os }}" == "macos-latest" ] && [ "${{ matrix.architecture }}" == "aarch64" ]; then - CC=aarch64-linux-gnu-gcc \ - CXX=aarch64-linux-gnu-g++ \ - cargo build --release --target $TARGET - else - cargo build --release --target $TARGET - fi + cargo build --release --target $TARGET cd target/${TARGET}/release tar -cjf goose-${TARGET}.tar.bz2 goose goosed echo "goose-${TARGET}.tar.bz2" >> $GITHUB_ENV + # Step 5: Upload the artifacts - uses: actions/upload-artifact@v4 with: name: goose-${{ matrix.architecture }}-${{ matrix.suffix }} path: target/${{ matrix.architecture }}-${{ matrix.suffix }}/release/goose-*.tar.bz2 - - release: - name: Release - runs-on: ubuntu-latest - needs: [build] - permissions: - contents: write - steps: - - uses: actions/download-artifact@v4 - with: - merge-multiple: true - - - uses: ncipollo/release-action@v1 - with: - artifacts: "goose-*.bz2" - token: ${{ secrets.GITHUB_TOKEN }} From 307504472ec8b2445e871ba2cfb906385bb1d31e Mon Sep 17 00:00:00 2001 From: Mic Neale Date: Wed, 18 Dec 2024 16:50:52 +1100 Subject: [PATCH 15/18] simplify junk2 --- .github/workflows/cli-release.yml | 51 +++++++++++++++++++++++-------- 1 file changed, 38 insertions(+), 13 deletions(-) diff --git a/.github/workflows/cli-release.yml b/.github/workflows/cli-release.yml index ee8fad103a86..6f2e586680bf 100644 --- a/.github/workflows/cli-release.yml +++ b/.github/workflows/cli-release.yml @@ -8,37 +8,41 @@ concurrency: group: ${{ github.workflow }} cancel-in-progress: true -name: Build CLI +name: Release CLI jobs: build: name: Build ${{ matrix.os }}-${{ matrix.architecture }} runs-on: ${{ matrix.os }} strategy: + fail-fast: false # Allow independent failures matrix: - os: [ubuntu-latest, macos-latest] - architecture: [x86_64, aarch64] include: + # Linux x86_64 build on Ubuntu - os: ubuntu-latest architecture: x86_64 suffix: unknown-linux-gnu + # macOS x86_64 build - os: macos-latest architecture: x86_64 suffix: apple-darwin + # macOS ARM build - os: macos-latest architecture: aarch64 suffix: apple-darwin + steps: - # Step 1: Checkout code - - uses: actions/checkout@v4 + # Step 1: Checkout the code + - name: Checkout code + uses: actions/checkout@v4 - # Step 2: Set up Rust toolchain - - name: Set up Rust + # Step 2: Set up Rust toolchain for the specific target + - name: Set up Rust toolchain uses: actions-rust-lang/setup-rust-toolchain@v1 with: target: ${{ matrix.architecture }}-${{ matrix.suffix }} - # Step 3: Install dependencies (macOS ARM only) + # Step 3: Install dependencies for macOS ARM builds - name: Install dependencies for macOS ARM if: matrix.os == 'macos-latest' && matrix.architecture == 'aarch64' run: | @@ -47,16 +51,37 @@ jobs: echo "export PATH=$(brew --prefix llvm)/bin:\$PATH" >> $GITHUB_ENV # Step 4: Build the project - - name: Build + - name: Build the project run: | export TARGET=${{ matrix.architecture }}-${{ matrix.suffix }} cargo build --release --target $TARGET cd target/${TARGET}/release tar -cjf goose-${TARGET}.tar.bz2 goose goosed - echo "goose-${TARGET}.tar.bz2" >> $GITHUB_ENV + echo "ARTIFACT=target/${TARGET}/release/goose-${TARGET}.tar.bz2" >> $GITHUB_ENV - # Step 5: Upload the artifacts - - uses: actions/upload-artifact@v4 + # Step 5: Upload artifacts + - name: Upload build artifact + uses: actions/upload-artifact@v4 with: name: goose-${{ matrix.architecture }}-${{ matrix.suffix }} - path: target/${{ matrix.architecture }}-${{ matrix.suffix }}/release/goose-*.tar.bz2 + path: ${{ env.ARTIFACT }} + + release: + name: Release + runs-on: ubuntu-latest + needs: [build] + permissions: + contents: write + steps: + # Step 1: Download all build artifacts + - name: Download build artifacts + uses: actions/download-artifact@v4 + with: + merge-multiple: true + + # Step 2: Create GitHub release and upload artifacts + - name: Create release + uses: ncipollo/release-action@v1 + with: + artifacts: "goose-*.tar.bz2" + token: ${{ secrets.GITHUB_TOKEN }} From b9365fe8f1a7b00a6db0d4363922e03305192ea6 Mon Sep 17 00:00:00 2001 From: Mic Neale Date: Wed, 18 Dec 2024 16:52:34 +1100 Subject: [PATCH 16/18] come on --- .github/workflows/cli-release.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/cli-release.yml b/.github/workflows/cli-release.yml index 6f2e586680bf..019bad0bc22b 100644 --- a/.github/workflows/cli-release.yml +++ b/.github/workflows/cli-release.yml @@ -1,7 +1,7 @@ on: push: tags: - - "v*" + - "v00.*" workflow_dispatch: concurrency: @@ -26,7 +26,7 @@ jobs: - os: macos-latest architecture: x86_64 suffix: apple-darwin - # macOS ARM build + # macOS ARM64 build - os: macos-latest architecture: aarch64 suffix: apple-darwin @@ -36,14 +36,14 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - # Step 2: Set up Rust toolchain for the specific target + # Step 2: Set up Rust toolchain - name: Set up Rust toolchain uses: actions-rust-lang/setup-rust-toolchain@v1 with: target: ${{ matrix.architecture }}-${{ matrix.suffix }} - # Step 3: Install dependencies for macOS ARM builds - - name: Install dependencies for macOS ARM + # Step 3: Install dependencies for macOS ARM64 builds + - name: Install dependencies for macOS ARM64 if: matrix.os == 'macos-latest' && matrix.architecture == 'aarch64' run: | brew install llvm @@ -51,7 +51,7 @@ jobs: echo "export PATH=$(brew --prefix llvm)/bin:\$PATH" >> $GITHUB_ENV # Step 4: Build the project - - name: Build the project + - name: Build run: | export TARGET=${{ matrix.architecture }}-${{ matrix.suffix }} cargo build --release --target $TARGET @@ -60,7 +60,7 @@ jobs: echo "ARTIFACT=target/${TARGET}/release/goose-${TARGET}.tar.bz2" >> $GITHUB_ENV # Step 5: Upload artifacts - - name: Upload build artifact + - name: Upload artifact uses: actions/upload-artifact@v4 with: name: goose-${{ matrix.architecture }}-${{ matrix.suffix }} @@ -74,13 +74,13 @@ jobs: contents: write steps: # Step 1: Download all build artifacts - - name: Download build artifacts + - name: Download all artifacts uses: actions/download-artifact@v4 with: merge-multiple: true - # Step 2: Create GitHub release and upload artifacts - - name: Create release + # Step 2: Publish release with artifacts + - name: Create GitHub release uses: ncipollo/release-action@v1 with: artifacts: "goose-*.tar.bz2" From 7b56c77159b5f1e708be430cc3004de21a2c7877 Mon Sep 17 00:00:00 2001 From: Mic Neale Date: Wed, 18 Dec 2024 17:46:15 +1100 Subject: [PATCH 17/18] adding required deps for ubuntu --- .github/workflows/cli-release.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/cli-release.yml b/.github/workflows/cli-release.yml index 019bad0bc22b..a9412a2fb58e 100644 --- a/.github/workflows/cli-release.yml +++ b/.github/workflows/cli-release.yml @@ -50,6 +50,14 @@ jobs: rustup target add aarch64-apple-darwin echo "export PATH=$(brew --prefix llvm)/bin:\$PATH" >> $GITHUB_ENV + - name: Install Libs for Ubuntu linux + if: matrix.os == 'ubuntu-latest' + run: | + sudo apt update -y + sudo apt install -y libdbus-1-dev libssl-dev gnome-keyring libxcb1-dev + gnome-keyring-daemon --components=secrets --daemonize --unlock <<< 'foobar' + + # Step 4: Build the project - name: Build run: | From 6d5c6d9972283e441d9a19e9b8074a472654273b Mon Sep 17 00:00:00 2001 From: Mic Neale Date: Wed, 18 Dec 2024 18:15:55 +1100 Subject: [PATCH 18/18] this actually works now --- .github/workflows/cli-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cli-release.yml b/.github/workflows/cli-release.yml index a9412a2fb58e..55aa42efe6a9 100644 --- a/.github/workflows/cli-release.yml +++ b/.github/workflows/cli-release.yml @@ -1,7 +1,7 @@ on: push: tags: - - "v00.*" + - "v1.*" workflow_dispatch: concurrency: