Skip to content

Commit

Permalink
Update publishing pipeline to support cross compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasfarias committed Mar 21, 2021
1 parent 948d631 commit 5e36efd
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
26 changes: 13 additions & 13 deletions .github/workflows/release_tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,17 @@ on:

jobs:
build:
name: Build and release
name: Build and release for ${{ matrix.job.os }}
strategy:
matrix:
target: [
x86_64-apple-darwin,
x86_64-unknown-linux-gnu,
x86_64-unknown-linux-musl
]
runs-on: ubuntu-latest
job:
- { os: macos-latest, target: x86_64-apple-darwin, use-cross: false }
- { os: windows-latest, target: x86_64-pc-windows-msvc, use-cross: false }
- { os: ubuntu-latest , target: x86_64-unknown-linux-gnu, use-cross: false }
- { os: ubuntu-latest, target: x86_64-unknown-linux-musl, use-cross: true }
- { os: ubuntu-latest, target: arm-unknown-linux-gnueabihf, use-cross: true }
- { os: ubuntu-latest, target: aarch64-unknown-linux-gnu, use-cross: true }
runs-on: ${{ matrix.job.os }}

steps:
- name: Checkout
Expand All @@ -26,21 +28,19 @@ jobs:
with:
toolchain: stable
profile: minimal
override: true
target: ${{ matrix.target }}

- name: Build target
uses: actions-rs/cargo@v1
with:
use-cross: true
use-cross: ${{ matrix.job.use-cross }}
command: build
args: --release --bin c2g --target ${{ matrix.target }}
args: --release --bin c2g --target ${{ matrix.job.target }}

- name: Package
shell: bash
run: |
cd target/${{ matrix.target }}/release
tar czvf ../../../c2g-${{ matrix.target }}.tar.gz c2g
cd target/${{ matrix.job.target }}/release
tar czvf ../../../c2g-${{ matrix.job.target }}.tar.gz c2g
cd -
- name: Release
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "c2g"
version = "0.2.0"
version = "0.2.1"
authors = ["Tomas Farias <[email protected]>"]
edition = "2018"

Expand Down

0 comments on commit 5e36efd

Please sign in to comment.