Skip to content

Commit

Permalink
Add release workflow (#18)
Browse files Browse the repository at this point in the history
* ci: Add release workflows

Signed-off-by: Maksim Dimitrov <[email protected]>

* ci: Fix secret

Signed-off-by: Maksim Dimitrov <[email protected]>

---------

Signed-off-by: Maksim Dimitrov <[email protected]>
  • Loading branch information
dimitrovmaksim committed Aug 11, 2023
1 parent d3f2566 commit e241c3e
Show file tree
Hide file tree
Showing 3 changed files with 126 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/release-mac-apple.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
42 changes: 42 additions & 0 deletions .github/workflows/release-mac-intel.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
42 changes: 42 additions & 0 deletions .github/workflows/release-ubuntu.yaml
Original file line number Diff line number Diff line change
@@ -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 }}

0 comments on commit e241c3e

Please sign in to comment.