From 13b24594587a13271b9f655896dc632d8ea14fad Mon Sep 17 00:00:00 2001 From: mpw Date: Mon, 2 Oct 2023 21:12:21 -0300 Subject: [PATCH 01/27] release build test --- .github/workflows/build.yml | 99 +++++++++++++++++++++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..184fee9 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,99 @@ +name: Test, build and release binary +on: + push: + branches: + #- main + - mpw/bin-release + pull_request: null + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +env: + REPOSITORY: ${{ github.event.repository.name }} + +jobs: + build: + runs-on: '${{ matrix.os }}' + strategy: + matrix: + include: + - os: macos-latest + target: x86_64-apple-darwin + suffix: '' + - os: macos-latest-xlarge + target: aarch64-apple-darwin + suffix: '' + - os: ubuntu-latest + target: x86_64-unknown-linux-gnu + suffix: '' + - os: windows-latest + target: x86_64-pc-windows-msvc + suffix: .exe + steps: + - uses: actions/checkout@master + with: + lfs: true + - uses: actions/download-artifact@master + with: + name: version + - id: get_version + run: echo ::set-output "name=VERSION::$(IFS=\=;cat Cargo.toml | grep version | head -n1 | awk {'print $3'})" + shell: bash + - uses: actions/cache@v1 + with: + path: ~/.cargo/registry + key: '${{ runner.os }}-cargo-registry-${{ hashFiles(''**/Cargo.lock'') }}' + - uses: actions/cache@v1 + with: + path: ~/.cargo/git + key: '${{ runner.os }}-cargo-index-${{ hashFiles(''**/Cargo.lock'') }}' + - uses: actions/cache@v1 + with: + path: target + key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }} + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + - uses: actions-rs/cargo@v1 + env: + VERSION: '${{ steps.get_version.outputs.VERSION }}' + with: + command: build + args: '--release' + - uses: actions/upload-artifact@master + with: + name: ${{ env.REPOSITORY }}-${{ matrix.target }} + path: ./target/release/${{ env.REPOSITORY }}${{ matrix.suffix }} + release: + needs: + - build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + with: + lfs: true + - uses: actions/download-artifact@master + with: + name: ${{ env.REPOSITORY }}-${{ matrix.target }} + path: ./${{ matrix.target }} + - id: create_release + uses: actions/create-release@v1.0.0 + env: + GITHUB_TOKEN: '${{ secrets.ACTIONS_TOKEN }}' + with: + tag_name: ${{ steps.get_version.outputs.VERSION }} + release_name: Release ${{ steps.get_version.outputs.VERSION}} + draft: false + prerelease: false + - uses: actions/upload-release-asset@v1.0.1 + env: + GITHUB_TOKEN: '${{ secrets.ACTIONS_TOKEN }}' + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./${{ matrix.target }}/${{ env.REPOSITORY }} + asset_name: ${{ env.REPOSITORY }}-${{ matrix.target }} + asset_content_type: application/octet-stream From f000be37f69e07d03d8726652e0147c86d8ca145 Mon Sep 17 00:00:00 2001 From: mpw Date: Mon, 2 Oct 2023 21:19:13 -0300 Subject: [PATCH 02/27] remove prev version download --- .github/workflows/build.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 184fee9..7266eae 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -35,9 +35,6 @@ jobs: - uses: actions/checkout@master with: lfs: true - - uses: actions/download-artifact@master - with: - name: version - id: get_version run: echo ::set-output "name=VERSION::$(IFS=\=;cat Cargo.toml | grep version | head -n1 | awk {'print $3'})" shell: bash From 8b45d67c140c36714895fab7cbe96e3044ece09d Mon Sep 17 00:00:00 2001 From: mpw Date: Mon, 2 Oct 2023 21:32:49 -0300 Subject: [PATCH 03/27] install deps --- .github/workflows/build.yml | 34 ++++++++++++++++++++++++++++++++++ ci/get-protoc.sh | 27 +++++++++++++++++++++++++++ 2 files changed, 61 insertions(+) create mode 100755 ci/get-protoc.sh diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7266eae..442a8f7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -38,6 +38,40 @@ jobs: - id: get_version run: echo ::set-output "name=VERSION::$(IFS=\=;cat Cargo.toml | grep version | head -n1 | awk {'print $3'})" shell: bash + + - name: Install dependencies + if: ${{ matrix.os }} == ubuntu-latest + run: | + sudo apt-get update -y && \ + sudo apt-get install -y --no-install-recommends \ + cmake \ + g++ \ + libsasl2-dev \ + libssl-dev \ + libudev-dev \ + pkg-config + + - name: Get protoc from github releases + if: ${{ matrix.os }} == ubuntu-latest + run: | + sudo ./ci/get-protoc.sh + + - name: Install dependencies + if: ${{ matrix.os == 'macos-latest' || matrix.os == 'macos-latest-xlarge' }} + run: | + brew install cmake gcc openssl@1.1 pkg-config protobuf + + - name: Install dependencies windows + if: ${{ matrix.os }} == windows-latest + run: | + choco install cmake mingw openssl pkgconfiglite protoc + + + - name: Get protoc from github releases + if: ${{ matrix.os }} == ubuntu-latest + run: | + sudo ./ci/get-protoc.sh + - uses: actions/cache@v1 with: path: ~/.cargo/registry diff --git a/ci/get-protoc.sh b/ci/get-protoc.sh new file mode 100755 index 0000000..bd1bb3f --- /dev/null +++ b/ci/get-protoc.sh @@ -0,0 +1,27 @@ +#!/bin/bash +set -eux +ARCHITECTURE=$(uname -m) + +if [[ $ARCHITECTURE == "x86_64" ]]; then + ARCHITECTURE="x86_64" +elif [[ $ARCHITECTURE == *'aarch'* ]]; then + ARCHITECTURE="aarch_64" +elif [[ $ARCHITECTURE == *'arm'* ]]; then + ARCHITECTURE="aarch_64" +else + echo "Unsupported architecture" + exit 1 +fi + +OS_TYPE=$(uname | tr '[:upper:]' '[:lower:]') + +PROTOC_VERSION="23.2" + +URL="https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VERSION}/protoc-${PROTOC_VERSION}-${OS_TYPE}-${ARCHITECTURE}.zip" + +wget -q "$URL" -O protoc.zip + +unzip protoc.zip +cp ./bin/protoc /usr/bin/protoc +protoc --version +rm -rf bin protoc.zip From 4889de691d65a5ac199a27d36805d30bf10b89ef Mon Sep 17 00:00:00 2001 From: mpw Date: Mon, 2 Oct 2023 21:34:26 -0300 Subject: [PATCH 04/27] remove duplicate protoc install --- .github/workflows/build.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 442a8f7..45b86f8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -51,11 +51,6 @@ jobs: libudev-dev \ pkg-config - - name: Get protoc from github releases - if: ${{ matrix.os }} == ubuntu-latest - run: | - sudo ./ci/get-protoc.sh - - name: Install dependencies if: ${{ matrix.os == 'macos-latest' || matrix.os == 'macos-latest-xlarge' }} run: | From 2c12a255a72818ba41d36f63c9839ce3ef29dd35 Mon Sep 17 00:00:00 2001 From: mpw Date: Mon, 2 Oct 2023 21:37:01 -0300 Subject: [PATCH 05/27] debug matrix os --- .github/workflows/build.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 45b86f8..99c3178 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -39,6 +39,9 @@ jobs: run: echo ::set-output "name=VERSION::$(IFS=\=;cat Cargo.toml | grep version | head -n1 | awk {'print $3'})" shell: bash + - name: Debug matrix.os + run: echo "OS is ${{ matrix.os }}" + - name: Install dependencies if: ${{ matrix.os }} == ubuntu-latest run: | From d651e3d1b25c292a2bcf2d7023889b986c132727 Mon Sep 17 00:00:00 2001 From: mpw Date: Mon, 2 Oct 2023 21:38:59 -0300 Subject: [PATCH 06/27] pls read the string --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 99c3178..0f43533 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -43,7 +43,7 @@ jobs: run: echo "OS is ${{ matrix.os }}" - name: Install dependencies - if: ${{ matrix.os }} == ubuntu-latest + if: ${{ matrix.os }} == 'ubuntu-latest' run: | sudo apt-get update -y && \ sudo apt-get install -y --no-install-recommends \ @@ -60,13 +60,13 @@ jobs: brew install cmake gcc openssl@1.1 pkg-config protobuf - name: Install dependencies windows - if: ${{ matrix.os }} == windows-latest + if: ${{ matrix.os }} == 'windows-latest' run: | choco install cmake mingw openssl pkgconfiglite protoc - name: Get protoc from github releases - if: ${{ matrix.os }} == ubuntu-latest + if: ${{ matrix.os }} == 'ubuntu-latest' run: | sudo ./ci/get-protoc.sh From 7d30c266576f3246e876ebd6c24e759f769d596b Mon Sep 17 00:00:00 2001 From: mpw Date: Mon, 2 Oct 2023 21:43:43 -0300 Subject: [PATCH 07/27] update if condition for dependency install --- .github/workflows/build.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0f43533..6d1a237 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -43,7 +43,7 @@ jobs: run: echo "OS is ${{ matrix.os }}" - name: Install dependencies - if: ${{ matrix.os }} == 'ubuntu-latest' + if: startsWith(matrix.os, 'ubuntu') run: | sudo apt-get update -y && \ sudo apt-get install -y --no-install-recommends \ @@ -55,18 +55,18 @@ jobs: pkg-config - name: Install dependencies - if: ${{ matrix.os == 'macos-latest' || matrix.os == 'macos-latest-xlarge' }} + if: startsWith(matrix.os, 'macOS') run: | brew install cmake gcc openssl@1.1 pkg-config protobuf - name: Install dependencies windows - if: ${{ matrix.os }} == 'windows-latest' + if: startsWith(matrix.os, 'windows') run: | choco install cmake mingw openssl pkgconfiglite protoc - name: Get protoc from github releases - if: ${{ matrix.os }} == 'ubuntu-latest' + if: startsWith(matrix.os, 'ubuntu') run: | sudo ./ci/get-protoc.sh From 9e71ca697743c06dbfa6644fac82c58f24b6de2e Mon Sep 17 00:00:00 2001 From: mpw Date: Mon, 2 Oct 2023 21:53:25 -0300 Subject: [PATCH 08/27] upload build wf --- .github/workflows/build.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6d1a237..232e358 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -48,6 +48,7 @@ jobs: sudo apt-get update -y && \ sudo apt-get install -y --no-install-recommends \ cmake \ + clang \ g++ \ libsasl2-dev \ libssl-dev \ @@ -96,7 +97,7 @@ jobs: - uses: actions/upload-artifact@master with: name: ${{ env.REPOSITORY }}-${{ matrix.target }} - path: ./target/release/${{ env.REPOSITORY }}${{ matrix.suffix }} + path: ./target/${{ matrix.target}}/${{ env.REPOSITORY }}${{ matrix.suffix }} release: needs: - build From 973dd6559a9faa5160fd975959e16f877fbd33e3 Mon Sep 17 00:00:00 2001 From: mpw Date: Mon, 2 Oct 2023 21:57:44 -0300 Subject: [PATCH 09/27] add liburing --- .github/workflows/build.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 232e358..e050930 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -49,6 +49,7 @@ jobs: sudo apt-get install -y --no-install-recommends \ cmake \ clang \ + liburing-dev \ g++ \ libsasl2-dev \ libssl-dev \ @@ -94,10 +95,15 @@ jobs: with: command: build args: '--release' + + - name: Rename binary + run: | + mv ./target/release/hub ./target/release/${{ env.REPOSITORY }}${{ matrix.suffix }} + - uses: actions/upload-artifact@master with: name: ${{ env.REPOSITORY }}-${{ matrix.target }} - path: ./target/${{ matrix.target}}/${{ env.REPOSITORY }}${{ matrix.suffix }} + path: ./target/release/${{ env.REPOSITORY }}${{ matrix.suffix }} release: needs: - build From c5020df2e49a91e1fb4a6690cee332fde35c6157 Mon Sep 17 00:00:00 2001 From: mpw Date: Mon, 2 Oct 2023 22:19:18 -0300 Subject: [PATCH 10/27] add suffix to windows build --- .github/workflows/build.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e050930..03a3290 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,6 +12,7 @@ concurrency: env: REPOSITORY: ${{ github.event.repository.name }} + BINARY_NAME: hub jobs: build: @@ -98,7 +99,7 @@ jobs: - name: Rename binary run: | - mv ./target/release/hub ./target/release/${{ env.REPOSITORY }}${{ matrix.suffix }} + mv ./target/release/${{ env.BINARY_NAME }}${{matrix.suffix}} ./target/release/${{ env.REPOSITORY }}${{ matrix.suffix }} - uses: actions/upload-artifact@master with: From e4edc39461fc4fbdbdfdad549bfdfa2fdce888b4 Mon Sep 17 00:00:00 2001 From: mpw Date: Mon, 2 Oct 2023 22:28:15 -0300 Subject: [PATCH 11/27] remove pkgconfiglite --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 03a3290..5979c07 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -65,7 +65,7 @@ jobs: - name: Install dependencies windows if: startsWith(matrix.os, 'windows') run: | - choco install cmake mingw openssl pkgconfiglite protoc + choco install cmake openssl protoc - name: Get protoc from github releases From 794aed764ce964783606b026c69bdecbbc998adb Mon Sep 17 00:00:00 2001 From: mpw Date: Mon, 2 Oct 2023 22:58:02 -0300 Subject: [PATCH 12/27] use os matrix to download artifacts --- .github/workflows/build.yml | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5979c07..4e9b057 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,4 +1,4 @@ -name: Test, build and release binary +name: Build and release binary on: push: branches: @@ -109,6 +109,21 @@ jobs: needs: - build runs-on: ubuntu-latest + strategy: + matrix: + include: + - os: macos-latest + target: x86_64-apple-darwin + suffix: '' + - os: macos-latest-xlarge + target: aarch64-apple-darwin + suffix: '' + - os: ubuntu-latest + target: x86_64-unknown-linux-gnu + suffix: '' + - os: windows-latest + target: x86_64-pc-windows-msvc + suffix: .exe steps: - uses: actions/checkout@master with: From 3d4f159b0bb71feccbddfb9e20ecaa4ac99b5350 Mon Sep 17 00:00:00 2001 From: mpw Date: Mon, 2 Oct 2023 23:03:48 -0300 Subject: [PATCH 13/27] cp instead of mv --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4e9b057..3ba682a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -99,7 +99,7 @@ jobs: - name: Rename binary run: | - mv ./target/release/${{ env.BINARY_NAME }}${{matrix.suffix}} ./target/release/${{ env.REPOSITORY }}${{ matrix.suffix }} + cp ./target/release/${{ env.BINARY_NAME }}${{matrix.suffix}} ./target/release/${{ env.REPOSITORY }}${{ matrix.suffix }} - uses: actions/upload-artifact@master with: From b8a5973850c77703ad1acc0ac86b741a27572b0c Mon Sep 17 00:00:00 2001 From: mpw Date: Mon, 2 Oct 2023 23:23:20 -0300 Subject: [PATCH 14/27] add default version to debug --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3ba682a..fbf99dd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -137,7 +137,7 @@ jobs: env: GITHUB_TOKEN: '${{ secrets.ACTIONS_TOKEN }}' with: - tag_name: ${{ steps.get_version.outputs.VERSION }} + tag_name: '${{ steps.get_version.outputs.VERSION || ''0.1.0'' }}' release_name: Release ${{ steps.get_version.outputs.VERSION}} draft: false prerelease: false From 73d9e6394c9aa6d7fea42a77065aa4aa6b0f1702 Mon Sep 17 00:00:00 2001 From: mpw Date: Tue, 3 Oct 2023 01:16:16 -0300 Subject: [PATCH 15/27] cleanup release --- .github/workflows/build.yml | 50 +++++++++++-------------------------- 1 file changed, 15 insertions(+), 35 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fbf99dd..d21333d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -101,51 +101,31 @@ jobs: run: | cp ./target/release/${{ env.BINARY_NAME }}${{matrix.suffix}} ./target/release/${{ env.REPOSITORY }}${{ matrix.suffix }} - - uses: actions/upload-artifact@master + - uses: actions/upload-artifact@v2 with: name: ${{ env.REPOSITORY }}-${{ matrix.target }} path: ./target/release/${{ env.REPOSITORY }}${{ matrix.suffix }} + if-no-files-found: error release: needs: - build runs-on: ubuntu-latest - strategy: - matrix: - include: - - os: macos-latest - target: x86_64-apple-darwin - suffix: '' - - os: macos-latest-xlarge - target: aarch64-apple-darwin - suffix: '' - - os: ubuntu-latest - target: x86_64-unknown-linux-gnu - suffix: '' - - os: windows-latest - target: x86_64-pc-windows-msvc - suffix: .exe steps: - uses: actions/checkout@master with: lfs: true - - uses: actions/download-artifact@master - with: - name: ${{ env.REPOSITORY }}-${{ matrix.target }} - path: ./${{ matrix.target }} - - id: create_release - uses: actions/create-release@v1.0.0 - env: - GITHUB_TOKEN: '${{ secrets.ACTIONS_TOKEN }}' - with: - tag_name: '${{ steps.get_version.outputs.VERSION || ''0.1.0'' }}' - release_name: Release ${{ steps.get_version.outputs.VERSION}} - draft: false - prerelease: false - - uses: actions/upload-release-asset@v1.0.1 + - uses: actions/download-artifact@v3 + + - name: Release + uses: softprops/action-gh-release@v1 env: - GITHUB_TOKEN: '${{ secrets.ACTIONS_TOKEN }}' + GITHUB_TOKEN: ${{ secrets.ACTIONS_TOKEN }} with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ./${{ matrix.target }}/${{ env.REPOSITORY }} - asset_name: ${{ env.REPOSITORY }}-${{ matrix.target }} - asset_content_type: application/octet-stream + generate_release_notes: true + draft: true + fail_on_unmatched_files: true + files: | + ${{ env.REPOSITORY }}-x86_64-apple-darwin + ${{ env.REPOSITORY }}-x86_64-unknown-linux-gnu + ${{ env.REPOSITORY }}-x86_64-pc-windows-msvc + ${{ env.REPOSITORY }}-aarch64-apple-darwin From 06cfafbfb8a285d9af111d6b6a518f7992a9f45b Mon Sep 17 00:00:00 2001 From: mpw Date: Tue, 3 Oct 2023 01:29:43 -0300 Subject: [PATCH 16/27] update uploaded artifacts path --- .github/workflows/build.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d21333d..034b061 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -125,7 +125,7 @@ jobs: draft: true fail_on_unmatched_files: true files: | - ${{ env.REPOSITORY }}-x86_64-apple-darwin - ${{ env.REPOSITORY }}-x86_64-unknown-linux-gnu - ${{ env.REPOSITORY }}-x86_64-pc-windows-msvc - ${{ env.REPOSITORY }}-aarch64-apple-darwin + ./${{ env.REPOSITORY }}/${{ env.REPOSITORY }}-x86_64-apple-darwin + ./${{ env.REPOSITORY }}/${{ env.REPOSITORY }}-x86_64-unknown-linux-gnu + ./${{ env.REPOSITORY }}/${{ env.REPOSITORY }}-x86_64-pc-windows-msvc + ./${{ env.REPOSITORY }}/${{ env.REPOSITORY }}-aarch64-apple-darwin From 83ae9ab4593384ebd1a066c74c9ed7ee86b1c21d Mon Sep 17 00:00:00 2001 From: mpw Date: Tue, 3 Oct 2023 01:48:20 -0300 Subject: [PATCH 17/27] add cargo test, update paths --- .github/workflows/build.yml | 14 ++++-- .github/workflows/cargo.yml | 86 +++++++++++++++++++++++++++++++++++++ 2 files changed, 96 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/cargo.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 034b061..0a9099f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -106,6 +106,7 @@ jobs: name: ${{ env.REPOSITORY }}-${{ matrix.target }} path: ./target/release/${{ env.REPOSITORY }}${{ matrix.suffix }} if-no-files-found: error + release: needs: - build @@ -116,6 +117,11 @@ jobs: lfs: true - uses: actions/download-artifact@v3 + - name: Move binaries + run: | + mv ~/work/hub-cli/hub-cli/* . + ls + - name: Release uses: softprops/action-gh-release@v1 env: @@ -125,7 +131,7 @@ jobs: draft: true fail_on_unmatched_files: true files: | - ./${{ env.REPOSITORY }}/${{ env.REPOSITORY }}-x86_64-apple-darwin - ./${{ env.REPOSITORY }}/${{ env.REPOSITORY }}-x86_64-unknown-linux-gnu - ./${{ env.REPOSITORY }}/${{ env.REPOSITORY }}-x86_64-pc-windows-msvc - ./${{ env.REPOSITORY }}/${{ env.REPOSITORY }}-aarch64-apple-darwin + ${{ env.REPOSITORY }}-x86_64-apple-darwin + ${{ env.REPOSITORY }}-x86_64-unknown-linux-gnu + ${{ env.REPOSITORY }}-x86_64-pc-windows-msvc + ${{ env.REPOSITORY }}-aarch64-apple-darwin diff --git a/.github/workflows/cargo.yml b/.github/workflows/cargo.yml new file mode 100644 index 0000000..52e55f5 --- /dev/null +++ b/.github/workflows/cargo.yml @@ -0,0 +1,86 @@ +name: Cargo + +on: + push: + branches: + - main + - release + pull_request: + branches: + - "**" + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + clippy: + name: clippy/check/doc + runs-on: amd64 + steps: + - name: Install dependencies + run: | + sudo apt-get update -y && \ + sudo apt-get install -y --no-install-recommends \ + libssl-dev \ + pkg-config + + - uses: actions/checkout@v3 + - name: Install latest nightly + uses: actions-rs/toolchain@v1 + with: + toolchain: 1.69.0 + override: true + components: rustfmt, clippy + + - uses: tespkg/actions-cache@v1 + with: + accessKey: ${{ secrets.AWS_ACCESS_KEY_ID }} + secretKey: ${{ secrets.AWS_SECRET_ACCESS_KEY }} + bucket: ${{ vars.AWS_BUCKET }} + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: ${{ github.event.repository.name }}-${{ runner.arch }}-cargo-clippy-${{ hashFiles('**/Cargo.lock', 'rust-toolchain.toml') }} + + - name: cargo clippy + uses: actions-rs/cargo@v1 + with: + command: clippy + args: --workspace --all-features + + - name: cargo check + uses: actions-rs/cargo@v1 + with: + command: check + args: --all-features --release + + - name: check lockfile + run: | + diff Cargo.lock <(git show HEAD:Cargo.lock) + + - name: cargo doc + uses: actions-rs/cargo@v1 + with: + command: doc + args: --workspace --all-features + + fmt: + name: cargo fmt + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Install latest nightly + uses: actions-rs/toolchain@v1 + with: + toolchain: nightly-2022-12-11 + override: true + components: rustfmt, clippy + - name: cargo fmt + uses: actions-rs/cargo@v1 + with: + command: fmt + args: --all --check From f0ace1c59fdf564e72d44f3b22f941bc75f71caa Mon Sep 17 00:00:00 2001 From: mpw Date: Tue, 3 Oct 2023 02:06:05 -0300 Subject: [PATCH 18/27] pls work --- .github/workflows/build.yml | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0a9099f..3611ef8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -40,9 +40,6 @@ jobs: run: echo ::set-output "name=VERSION::$(IFS=\=;cat Cargo.toml | grep version | head -n1 | awk {'print $3'})" shell: bash - - name: Debug matrix.os - run: echo "OS is ${{ matrix.os }}" - - name: Install dependencies if: startsWith(matrix.os, 'ubuntu') run: | @@ -76,11 +73,11 @@ jobs: - uses: actions/cache@v1 with: path: ~/.cargo/registry - key: '${{ runner.os }}-cargo-registry-${{ hashFiles(''**/Cargo.lock'') }}' + key: '${{ runner.os }}-${{ matrix.target }}-cargo-registry-${{ hashFiles(''**/Cargo.lock'') }}' - uses: actions/cache@v1 with: path: ~/.cargo/git - key: '${{ runner.os }}-cargo-index-${{ hashFiles(''**/Cargo.lock'') }}' + key: '${{ runner.os }}-${{ matrix.target }}-cargo-index-${{ hashFiles(''**/Cargo.lock'') }}' - uses: actions/cache@v1 with: path: target @@ -119,8 +116,8 @@ jobs: - name: Move binaries run: | - mv ~/work/hub-cli/hub-cli/* . - ls + cp ~/work/hub-cli/hub-cli/hub-cli* . + ls hub-cli* - name: Release uses: softprops/action-gh-release@v1 From b5d4f28bc47a2e71a8f617adea2ae0872f7280f8 Mon Sep 17 00:00:00 2001 From: mpw Date: Tue, 3 Oct 2023 02:15:12 -0300 Subject: [PATCH 19/27] omg --- .github/workflows/build.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3611ef8..a0dd54e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -116,8 +116,7 @@ jobs: - name: Move binaries run: | - cp ~/work/hub-cli/hub-cli/hub-cli* . - ls hub-cli* + cp -r ~/work/hub-cli/hub-cli/hub-cli* . - name: Release uses: softprops/action-gh-release@v1 From fc3f6d18d05052b6b62051012329939e53a095fa Mon Sep 17 00:00:00 2001 From: mpw Date: Tue, 3 Oct 2023 02:31:05 -0300 Subject: [PATCH 20/27] what --- .github/workflows/build.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a0dd54e..22b7912 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -114,9 +114,10 @@ jobs: lfs: true - uses: actions/download-artifact@v3 - - name: Move binaries + - name: debug ls run: | - cp -r ~/work/hub-cli/hub-cli/hub-cli* . + pwd + ls - name: Release uses: softprops/action-gh-release@v1 From f8246a143243d0cc3962c1d81ac690d57f9a9d5b Mon Sep 17 00:00:00 2001 From: mpw Date: Tue, 3 Oct 2023 02:47:00 -0300 Subject: [PATCH 21/27] why not working --- .github/workflows/build.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 22b7912..9ff79c9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -128,7 +128,7 @@ jobs: draft: true fail_on_unmatched_files: true files: | - ${{ env.REPOSITORY }}-x86_64-apple-darwin - ${{ env.REPOSITORY }}-x86_64-unknown-linux-gnu - ${{ env.REPOSITORY }}-x86_64-pc-windows-msvc - ${{ env.REPOSITORY }}-aarch64-apple-darwin + hub-cli-aarch64-apple-darwin + hub-cli-x86_64-apple-darwin + hub-cli-x86_64-pc-windows-msvc + hub-cli-x86_64-unknown-linux-gnu From 8697abc912d315c1cf1a8777fc7eea2718cf785c Mon Sep 17 00:00:00 2001 From: mpw Date: Tue, 3 Oct 2023 03:07:17 -0300 Subject: [PATCH 22/27] debugging --- .github/workflows/build.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9ff79c9..be72c88 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -119,6 +119,11 @@ jobs: pwd ls + - name: Debugging + run: | + ls -al + file hub-cli-aarch64-apple-darwin + - name: Release uses: softprops/action-gh-release@v1 env: From de123c9001d76d5f31c342c744d84bbcc007f971 Mon Sep 17 00:00:00 2001 From: mpw Date: Tue, 3 Oct 2023 03:26:25 -0300 Subject: [PATCH 23/27] more debug --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index be72c88..8fda78b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -123,6 +123,7 @@ jobs: run: | ls -al file hub-cli-aarch64-apple-darwin + ls -al hub-cli-aarch64-apple-darwin - name: Release uses: softprops/action-gh-release@v1 From 384f57e37d20edf3e0eef7b5b29b07636b4d7b31 Mon Sep 17 00:00:00 2001 From: mpw Date: Tue, 3 Oct 2023 03:49:29 -0300 Subject: [PATCH 24/27] update workflow --- .github/workflows/build.yml | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8fda78b..3feb855 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -114,16 +114,12 @@ jobs: lfs: true - uses: actions/download-artifact@v3 - - name: debug ls + - name: Move binaries run: | - pwd - ls - - - name: Debugging - run: | - ls -al - file hub-cli-aarch64-apple-darwin - ls -al hub-cli-aarch64-apple-darwin + mv ${{ env.REPOSITORY }}-x86_64-apple-darwin/${{ env.REPOSITORY }} hub-x86_64-apple-darwin + mv ${{ env.REPOSITORY }}-x86_64-unknown-linux-gnu/${{ env.REPOSITORY }} hub-x86_64-unknown-linux-gnu + mv ${{ env.REPOSITORY }}-x86_64-pc-windows-msvc/${{ env.REPOSITORY }}.exe hub-x86_64-pc-windows.exe + mv ${{ env.REPOSITORY }}-aarch64-apple-darwin/${{ env.REPOSITORY }} hub-aarch64-apple-darwin - name: Release uses: softprops/action-gh-release@v1 @@ -134,7 +130,7 @@ jobs: draft: true fail_on_unmatched_files: true files: | - hub-cli-aarch64-apple-darwin - hub-cli-x86_64-apple-darwin - hub-cli-x86_64-pc-windows-msvc - hub-cli-x86_64-unknown-linux-gnu + hub-x86_64-apple-darwin + hub-x86_64-unknown-linux-gnu + hub-x86_64-pc-windows.exe + hub-aarch64-apple-darwin From ba2ed430c93a3d38721dc506e468403329b24eec Mon Sep 17 00:00:00 2001 From: mpw Date: Tue, 3 Oct 2023 04:07:45 -0300 Subject: [PATCH 25/27] remove test branch from ci --- .github/workflows/build.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3feb855..51db625 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,8 +2,7 @@ name: Build and release binary on: push: branches: - #- main - - mpw/bin-release + - main pull_request: null concurrency: From 7247e4c30369e48bbf99794b8ad01e40961390b3 Mon Sep 17 00:00:00 2001 From: mpw Date: Tue, 3 Oct 2023 04:11:14 -0300 Subject: [PATCH 26/27] remove tests from workflow --- .github/workflows/cargo.yml | 86 ------------------------------------- 1 file changed, 86 deletions(-) delete mode 100644 .github/workflows/cargo.yml diff --git a/.github/workflows/cargo.yml b/.github/workflows/cargo.yml deleted file mode 100644 index 52e55f5..0000000 --- a/.github/workflows/cargo.yml +++ /dev/null @@ -1,86 +0,0 @@ -name: Cargo - -on: - push: - branches: - - main - - release - pull_request: - branches: - - "**" - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - clippy: - name: clippy/check/doc - runs-on: amd64 - steps: - - name: Install dependencies - run: | - sudo apt-get update -y && \ - sudo apt-get install -y --no-install-recommends \ - libssl-dev \ - pkg-config - - - uses: actions/checkout@v3 - - name: Install latest nightly - uses: actions-rs/toolchain@v1 - with: - toolchain: 1.69.0 - override: true - components: rustfmt, clippy - - - uses: tespkg/actions-cache@v1 - with: - accessKey: ${{ secrets.AWS_ACCESS_KEY_ID }} - secretKey: ${{ secrets.AWS_SECRET_ACCESS_KEY }} - bucket: ${{ vars.AWS_BUCKET }} - path: | - ~/.cargo/bin/ - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - target/ - key: ${{ github.event.repository.name }}-${{ runner.arch }}-cargo-clippy-${{ hashFiles('**/Cargo.lock', 'rust-toolchain.toml') }} - - - name: cargo clippy - uses: actions-rs/cargo@v1 - with: - command: clippy - args: --workspace --all-features - - - name: cargo check - uses: actions-rs/cargo@v1 - with: - command: check - args: --all-features --release - - - name: check lockfile - run: | - diff Cargo.lock <(git show HEAD:Cargo.lock) - - - name: cargo doc - uses: actions-rs/cargo@v1 - with: - command: doc - args: --workspace --all-features - - fmt: - name: cargo fmt - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Install latest nightly - uses: actions-rs/toolchain@v1 - with: - toolchain: nightly-2022-12-11 - override: true - components: rustfmt, clippy - - name: cargo fmt - uses: actions-rs/cargo@v1 - with: - command: fmt - args: --all --check From 2857ed11c3004f4f41c849cd96fc61e81fef262b Mon Sep 17 00:00:00 2001 From: mpw Date: Tue, 3 Oct 2023 04:12:08 -0300 Subject: [PATCH 27/27] remove build workflow from prs --- .github/workflows/build.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 51db625..401def1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,7 +3,6 @@ on: push: branches: - main - pull_request: null concurrency: group: ${{ github.workflow }}-${{ github.ref }}