From e241c3e498e070eb7d0a8bba9eee8bac5d48fe70 Mon Sep 17 00:00:00 2001 From: Maksim Dimitrov Date: Tue, 8 Aug 2023 13:02:53 +0300 Subject: [PATCH] Add release workflow (#18) * ci: Add release workflows Signed-off-by: Maksim Dimitrov * ci: Fix secret Signed-off-by: Maksim Dimitrov --------- Signed-off-by: Maksim Dimitrov --- .github/workflows/release-mac-apple.yaml | 42 ++++++++++++++++++++++++ .github/workflows/release-mac-intel.yaml | 42 ++++++++++++++++++++++++ .github/workflows/release-ubuntu.yaml | 42 ++++++++++++++++++++++++ 3 files changed, 126 insertions(+) create mode 100644 .github/workflows/release-mac-apple.yaml create mode 100644 .github/workflows/release-mac-intel.yaml create mode 100644 .github/workflows/release-ubuntu.yaml diff --git a/.github/workflows/release-mac-apple.yaml b/.github/workflows/release-mac-apple.yaml new file mode 100644 index 0000000..ac00f51 --- /dev/null +++ b/.github/workflows/release-mac-apple.yaml @@ -0,0 +1,42 @@ +name: Release MacOS - Apple Silicon + +on: + release: + types: + - created + +env: + CARGO_TERM_COLOR: always + +jobs: + deploy: + name: Deploy for MacOS (Apple) + if: startsWith(github.ref, 'refs/tags') + runs-on: ${{ matrix.os }} + strategy: + matrix: + name: [macos-12-apple, macos-13-apple] + + include: + - name: macos-12-apple + os: macos-12 + artifact_name: wasm_injector + asset_name: wasm-injector-macos12-apple + - name: macos-13-apple + os: macos-13 + artifact_name: wasm_injector + asset_name: wasm-injector-macos13-apple + + steps: + - uses: actions/checkout@v2 + + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + + - name: Build + run: rustup target add aarch64-apple-darwin && cargo build --release --target aarch64-apple-darwin && mv target/aarch64-apple-darwin/release/${{ matrix.artifact_name }} target/release/${{ matrix.asset_name }} + + - name: Upload binary to release + run: echo ${{ secrets.GITHUB_TOKEN }} | gh auth login --with-token && gh release upload ${GITHUB_REF##*/} target/release/${{ matrix.asset_name }} \ No newline at end of file diff --git a/.github/workflows/release-mac-intel.yaml b/.github/workflows/release-mac-intel.yaml new file mode 100644 index 0000000..ff53703 --- /dev/null +++ b/.github/workflows/release-mac-intel.yaml @@ -0,0 +1,42 @@ +name: Release MacOS - Intel + +on: + release: + types: + - created + +env: + CARGO_TERM_COLOR: always + +jobs: + deploy: + name: Deploy for MacOS (Intel) + if: startsWith(github.ref, 'refs/tags') + runs-on: ${{ matrix.os }} + strategy: + matrix: + name: [macos-12, macos-13] + + include: + - name: macos-12 + os: macos-12 + artifact_name: wasm_injector + asset_name: wasm-injector-macos12-intel + - name: macos-13 + os: macos-13 + artifact_name: wasm_injector + asset_name: wasm-injector-macos13-intel + + steps: + - uses: actions/checkout@v2 + + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + + - name: Build + run: cargo build --release && mv target/release/${{ matrix.artifact_name }} target/release/${{ matrix.asset_name }} + + - name: Upload binaries to release + run: echo ${{ secrets.GITHUB_TOKEN }} | gh auth login --with-token && gh release upload ${GITHUB_REF##*/} target/release/${{ matrix.asset_name }} \ No newline at end of file diff --git a/.github/workflows/release-ubuntu.yaml b/.github/workflows/release-ubuntu.yaml new file mode 100644 index 0000000..1fa311c --- /dev/null +++ b/.github/workflows/release-ubuntu.yaml @@ -0,0 +1,42 @@ +name: Release Ubuntu + +on: + release: + types: + - created + +env: + CARGO_TERM_COLOR: always + +jobs: + deploy: + name: Deploy for ${{ matrix.os }} + if: startsWith(github.ref, 'refs/tags') + runs-on: ${{ matrix.os }} + strategy: + matrix: + name: [ubuntu-20, ubuntu-22] + + include: + - name: ubuntu-20 + os: ubuntu-20.04 + artifact_name: wasm_injector + asset_name: wasm-injector-ubuntu-20 + - name: ubuntu-22 + os: ubuntu-22.04 + artifact_name: wasm_injector + asset_name: wasm-injector-ubuntu-22 + + steps: + - uses: actions/checkout@v2 + + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + + - name: Build + run: cargo build --release && mv target/release/${{ matrix.artifact_name }} target/release/${{ matrix.asset_name }} + + - name: Upload binaries to release + run: echo ${{ secrets.GITHUB_TOKEN }} | gh auth login --with-token && gh release upload ${GITHUB_REF##*/} target/release/${{ matrix.asset_name }} \ No newline at end of file