Skip to content

Commit

Permalink
chore(ci): add macos and windows build target
Browse files Browse the repository at this point in the history
  • Loading branch information
ckaznable committed Feb 14, 2023
1 parent d11154a commit 7913a7c
Showing 1 changed file with 75 additions and 3 deletions.
78 changes: 75 additions & 3 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:

strategy:
matrix:
build: [stable, nightly]
build: [stable, beta, nightly]
include:
- build: nightly
benches: true
Expand All @@ -59,8 +59,9 @@ jobs:
- name: Test all benches
if: matrix.benches
run: cargo test --benches --all-features
deploy:
name: deploy

deploy-linux:
name: deploy-${{ matrix.target }}
permissions:
contents: write
needs: [test]
Expand All @@ -81,6 +82,77 @@ jobs:
- name: Build target
run: cargo build --release --target ${{ matrix.target }}

- name: Package
shell: bash
run: |
#strip target/${{ matrix.target }}/release/poketex
cd target/${{ matrix.target }}/release
tar czvf ../../../poketex-${{ matrix.target }}.tar.gz poketex
cd -
- name: Publish
uses: softprops/action-gh-release@v1
with:
files: 'poketex*'

deploy-macos:
name: deploy-${{ matrix.target }}
permissions:
contents: write
needs: [test]
if: startsWith(github.ref, 'refs/tags/')
runs-on: macos-latest
strategy:
matrix:
target: [x86_64-apple-darwin, aarch64-apple-darwin]
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup rust
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}

- run: rustup target add aarch64-apple-darwin
if: matrix.target == 'aarch64-apple-darwin'

- name: Build target
run: cargo build --release --target ${{ matrix.target }}

- name: Package
shell: bash
run: |
#strip target/${{ matrix.target }}/release/poketex
cd target/${{ matrix.target }}/release
tar czvf ../../../poketex-${{ matrix.target }}.tar.gz poketex
cd -
- name: Publish
uses: softprops/action-gh-release@v1
with:
files: 'poketex*'

deploy-windows:
name: deploy-${{ matrix.target }}
permissions:
contents: write
needs: [test]
if: startsWith(github.ref, 'refs/tags/')
runs-on: windows-latest
strategy:
matrix:
target: [x86_64-pc-windows-msvc]
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup rust
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}

- name: Build target
run: cargo build --release --target ${{ matrix.target }}

- name: Package
shell: bash
run: |
Expand Down

0 comments on commit 7913a7c

Please sign in to comment.