From e179303f2577f826da95a007ef048da3428864b7 Mon Sep 17 00:00:00 2001 From: sslivkoff Date: Mon, 29 Jan 2024 00:03:05 -0800 Subject: [PATCH 01/14] initial binary release workflow --- .github/workflows/release.yml | 57 +++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..26f1aa7 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,57 @@ + +name: Release + +on: + workflow_dispatch: + +jobs: + build: + name: Build on ${{ matrix.os }} for ${{ matrix.arch }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + arch: [amd64, arm64] + include: + - os: ubuntu-latest + arch: arm64 + target: aarch64-unknown-linux-gnu + - os: macos-latest + arch: arm64 + target: aarch64-apple-darwin + exclude: + - os: windows-latest + arch: arm64 + + steps: + - name: Checkout Repository + uses: actions/checkout@v2 + + - name: Install Dependencies (Ubuntu) + if: matrix.os == 'ubuntu-latest' + run: | + sudo apt-get update + sudo apt-get install pkg-config libssl-dev + + - name: Install Rust + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + profile: minimal + override: true + target: ${{ matrix.target }} + + - name: Build Binary + run: | + cd rust + cargo build --release --target ${{ matrix.target }} --path crates/mesc_cli + + - name: Publish Release + if: startsWith(github.ref, 'refs/tags/') + uses: softprops/action-gh-release@v1 + with: + files: | + rust/target/${{ matrix.target }}/release/mesc_cli* + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + From ce82da7985ef9f72c68c0314e489e3da56e54137 Mon Sep 17 00:00:00 2001 From: sslivkoff Date: Mon, 29 Jan 2024 00:08:40 -0800 Subject: [PATCH 02/14] update manifest path --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 26f1aa7..f5159d0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -44,7 +44,7 @@ jobs: - name: Build Binary run: | cd rust - cargo build --release --target ${{ matrix.target }} --path crates/mesc_cli + cargo build --release --target ${{ matrix.target }} --manifest-path crates/mesc_cli/Cargo.toml - name: Publish Release if: startsWith(github.ref, 'refs/tags/') From 4d479c464f2e065c2c8b9ae108d27bb5b2a8f8c3 Mon Sep 17 00:00:00 2001 From: sslivkoff Date: Mon, 29 Jan 2024 00:15:30 -0800 Subject: [PATCH 03/14] update build workflow --- .github/workflows/release.yml | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f5159d0..c41d7b0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,4 +1,3 @@ - name: Release on: @@ -10,25 +9,29 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-latest, macos-latest, windows-latest] - arch: [amd64, arm64] include: + - os: ubuntu-latest + arch: amd64 + target: x86_64-unknown-linux-gnu - os: ubuntu-latest arch: arm64 target: aarch64-unknown-linux-gnu + - os: macos-latest + arch: amd64 + target: x86_64-apple-darwin - os: macos-latest arch: arm64 target: aarch64-apple-darwin - exclude: - os: windows-latest - arch: arm64 + arch: amd64 + target: x86_64-pc-windows-msvc steps: - name: Checkout Repository uses: actions/checkout@v2 - name: Install Dependencies (Ubuntu) - if: matrix.os == 'ubuntu-latest' + if: startsWith(matrix.os, 'ubuntu') run: | sudo apt-get update sudo apt-get install pkg-config libssl-dev @@ -44,7 +47,7 @@ jobs: - name: Build Binary run: | cd rust - cargo build --release --target ${{ matrix.target }} --manifest-path crates/mesc_cli/Cargo.toml + cargo build --release --manifest-path=crates/mesc_cli/Cargo.toml --target ${{ matrix.target }} - name: Publish Release if: startsWith(github.ref, 'refs/tags/') @@ -54,4 +57,3 @@ jobs: rust/target/${{ matrix.target }}/release/mesc_cli* env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - From 0e89d488345640bd8f8d7e02613377dd37137775 Mon Sep 17 00:00:00 2001 From: sslivkoff Date: Mon, 29 Jan 2024 00:19:49 -0800 Subject: [PATCH 04/14] add gcc arm64 --- .github/workflows/release.yml | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c41d7b0..8e33666 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,15 +16,7 @@ jobs: - os: ubuntu-latest arch: arm64 target: aarch64-unknown-linux-gnu - - os: macos-latest - arch: amd64 - target: x86_64-apple-darwin - - os: macos-latest - arch: arm64 - target: aarch64-apple-darwin - - os: windows-latest - arch: amd64 - target: x86_64-pc-windows-msvc + # ... other matrix entries ... steps: - name: Checkout Repository @@ -36,6 +28,12 @@ jobs: sudo apt-get update sudo apt-get install pkg-config libssl-dev + - name: Install Cross-Compilation Tools (ARM64) + if: matrix.target == 'aarch64-unknown-linux-gnu' + run: | + sudo apt-get update + sudo apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu + - name: Install Rust uses: actions-rs/toolchain@v1 with: From e9eb52f5c19fca8ef878aa997edef86be765ed68 Mon Sep 17 00:00:00 2001 From: sslivkoff Date: Mon, 29 Jan 2024 00:22:20 -0800 Subject: [PATCH 05/14] add back in other arch's --- .github/workflows/release.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8e33666..5eb1253 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,7 +16,16 @@ jobs: - os: ubuntu-latest arch: arm64 target: aarch64-unknown-linux-gnu - # ... other matrix entries ... + - os: macos-latest + arch: amd64 + target: x86_64-apple-darwin + - os: macos-latest + arch: arm64 + target: aarch64-apple-darwin + - os: windows-latest + arch: amd64 + target: x86_64-pc-windows-msvc + steps: - name: Checkout Repository From 097d28d1c0e9dca4a1ef3d53539f6fb4b62fe4c1 Mon Sep 17 00:00:00 2001 From: sslivkoff Date: Mon, 29 Jan 2024 00:26:32 -0800 Subject: [PATCH 06/14] add more deps --- .github/workflows/release.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5eb1253..141e293 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,6 +8,7 @@ jobs: name: Build on ${{ matrix.os }} for ${{ matrix.arch }} runs-on: ${{ matrix.os }} strategy: + fail-fast: false matrix: include: - os: ubuntu-latest @@ -26,7 +27,6 @@ jobs: arch: amd64 target: x86_64-pc-windows-msvc - steps: - name: Checkout Repository uses: actions/checkout@v2 @@ -42,6 +42,15 @@ jobs: run: | sudo apt-get update sudo apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu + sudo apt-get install -y pkg-config-aarch64-linux-gnu + sudo apt-get install -y libssl-dev:arm64 + + - name: Set up Environment for Cross-Compilation (ARM64) + if: matrix.target == 'aarch64-unknown-linux-gnu' + run: | + echo "PKG_CONFIG_ALLOW_CROSS=1" >> $GITHUB_ENV + echo "PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig" >> $GITHUB_ENV + echo "OPENSSL_DIR=/usr/lib/aarch64-linux-gnu" >> $GITHUB_ENV - name: Install Rust uses: actions-rs/toolchain@v1 From 58fd16f9114ab6c28c27ad5e4388efe0b4cada2c Mon Sep 17 00:00:00 2001 From: sslivkoff Date: Mon, 29 Jan 2024 00:29:48 -0800 Subject: [PATCH 07/14] fix deps --- .github/workflows/release.yml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 141e293..fa983bf 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -31,20 +31,23 @@ jobs: - name: Checkout Repository uses: actions/checkout@v2 - - name: Install Dependencies (Ubuntu) - if: startsWith(matrix.os, 'ubuntu') + - name: Install Common Dependencies run: | sudo apt-get update - sudo apt-get install pkg-config libssl-dev + sudo apt-get install -y pkg-config libssl-dev - - name: Install Cross-Compilation Tools (ARM64) + - name: Install Cross-Compilation Tools for ARM64 if: matrix.target == 'aarch64-unknown-linux-gnu' run: | - sudo apt-get update sudo apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu - sudo apt-get install -y pkg-config-aarch64-linux-gnu sudo apt-get install -y libssl-dev:arm64 + - name: Configure PKG_CONFIG_PATH for ARM64 + if: matrix.target == 'aarch64-unknown-linux-gnu' + run: | + echo "PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig" >> $GITHUB_ENV + echo "PKG_CONFIG_ALLOW_CROSS=1" >> $GITHUB_ENV + - name: Set up Environment for Cross-Compilation (ARM64) if: matrix.target == 'aarch64-unknown-linux-gnu' run: | From 052986be5e8cf760979e413cad8c38cebd293878 Mon Sep 17 00:00:00 2001 From: sslivkoff Date: Mon, 29 Jan 2024 00:38:05 -0800 Subject: [PATCH 08/14] fix deps --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fa983bf..ab8b8c6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -31,7 +31,8 @@ jobs: - name: Checkout Repository uses: actions/checkout@v2 - - name: Install Common Dependencies + - name: Install Common Dependencies (Ubuntu) + if: startsWith(matrix.os, 'ubuntu') run: | sudo apt-get update sudo apt-get install -y pkg-config libssl-dev @@ -40,7 +41,6 @@ jobs: if: matrix.target == 'aarch64-unknown-linux-gnu' run: | sudo apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu - sudo apt-get install -y libssl-dev:arm64 - name: Configure PKG_CONFIG_PATH for ARM64 if: matrix.target == 'aarch64-unknown-linux-gnu' From d56a57d6b68d090676abec027d4e6212adb1a8a8 Mon Sep 17 00:00:00 2001 From: sslivkoff Date: Mon, 29 Jan 2024 00:43:45 -0800 Subject: [PATCH 09/14] avoid arm64 ubuntu for now --- .github/workflows/release.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ab8b8c6..5aab3d9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,9 +14,9 @@ jobs: - os: ubuntu-latest arch: amd64 target: x86_64-unknown-linux-gnu - - os: ubuntu-latest - arch: arm64 - target: aarch64-unknown-linux-gnu + # - os: ubuntu-latest + # arch: arm64 + # target: aarch64-unknown-linux-gnu - os: macos-latest arch: amd64 target: x86_64-apple-darwin From 612902640abdc06f63fbea70384a66888a1a7eea Mon Sep 17 00:00:00 2001 From: sslivkoff Date: Mon, 29 Jan 2024 00:54:25 -0800 Subject: [PATCH 10/14] change publishing flow --- .github/workflows/release.yml | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5aab3d9..5f19ec0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -68,11 +68,34 @@ jobs: cd rust cargo build --release --manifest-path=crates/mesc_cli/Cargo.toml --target ${{ matrix.target }} - - name: Publish Release - if: startsWith(github.ref, 'refs/tags/') + - name: Upload Artifact + uses: actions/upload-artifact@v2 + with: + name: binary-${{ matrix.target }} + path: path/to/your/binary + + publish_release: + needs: build + runs-on: ubuntu-latest + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') + steps: + - name: Checkout Repository + uses: actions/checkout@v2 + + - name: Download All Artifacts + uses: actions/download-artifact@v2 + with: + path: artifacts + + - name: Create Release + id: create_release uses: softprops/action-gh-release@v1 with: files: | - rust/target/${{ matrix.target }}/release/mesc_cli* + artifacts/* + name: ${{ github.event.inputs.release_name || github.ref_name }} + tag_name: ${{ github.ref_name }} + draft: false + prerelease: false env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 2b7bd0f2ac2e8931037198fac4702397c90455c2 Mon Sep 17 00:00:00 2001 From: sslivkoff Date: Mon, 29 Jan 2024 00:55:36 -0800 Subject: [PATCH 11/14] add input for release name --- .github/workflows/release.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5f19ec0..3d4ec89 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,6 +2,11 @@ name: Release on: workflow_dispatch: + inputs: + release_name: + description: 'Release Name' + required: false + default: '' jobs: build: From a7913273ee507b5c5caacf382a79d903a2637ad7 Mon Sep 17 00:00:00 2001 From: sslivkoff Date: Mon, 29 Jan 2024 01:23:51 -0800 Subject: [PATCH 12/14] remove conditional --- .github/workflows/release.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3d4ec89..3eafe83 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -82,7 +82,6 @@ jobs: publish_release: needs: build runs-on: ubuntu-latest - if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') steps: - name: Checkout Repository uses: actions/checkout@v2 From 28a41c59e3b40cb390e51a9229ab65d144367a43 Mon Sep 17 00:00:00 2001 From: sslivkoff Date: Mon, 29 Jan 2024 02:04:13 -0800 Subject: [PATCH 13/14] specify build artifact path --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3eafe83..46ec673 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -77,7 +77,7 @@ jobs: uses: actions/upload-artifact@v2 with: name: binary-${{ matrix.target }} - path: path/to/your/binary + path: rust/target/${{ matrix.target }}/release/mesc_cli publish_release: needs: build From 3f1115cd734c73515caad9c5f72c80bc60665be3 Mon Sep 17 00:00:00 2001 From: sslivkoff Date: Mon, 29 Jan 2024 09:11:27 -0800 Subject: [PATCH 14/14] add mention of mesc binary to artifact list --- .github/workflows/release.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 46ec673..26b24af 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -77,7 +77,7 @@ jobs: uses: actions/upload-artifact@v2 with: name: binary-${{ matrix.target }} - path: rust/target/${{ matrix.target }}/release/mesc_cli + path: rust/target/${{ matrix.target }}/release/mesc publish_release: needs: build @@ -95,8 +95,7 @@ jobs: id: create_release uses: softprops/action-gh-release@v1 with: - files: | - artifacts/* + files: artifacts/** name: ${{ github.event.inputs.release_name || github.ref_name }} tag_name: ${{ github.ref_name }} draft: false