Skip to content

Commit

Permalink
feat: update pipeline to allow more build targets
Browse files Browse the repository at this point in the history
  • Loading branch information
chimbosonic committed Feb 22, 2024
1 parent cdc7f10 commit fa6dd27
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 2 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/_build_target.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: build_target

on:
workflow_call:
inputs:
target:
type: string
description: 'Build target'
required: true
channel:
type: string
description: 'Build target'
required: false
default: 'stable'

env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install Rust
run: rustup update ${inputs.channel}

- name: Install cross-compilation tools
uses: taiki-e/setup-cross-toolchain-action@v1
with:
target: ${inputs.target}

- run: cargo build --release

- name: Package ${inputs.channel}-${inputs.target}
run: |
tar -cvzf kneeboard-${inputs.channel}-${inputs.target}.tar.gz README.md LICENSE -C ./target/release kneeboard
- uses: actions/upload-artifact@v4
with:
name: kneeboard-${inputs.channel}-${inputs.target}
path: kneeboard-${inputs.channel}-${inputs.target}.tar.gz

2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
- run: cargo fmt --all -- --check
build-targets:
name: Build targets
uses: ./.github/workflows/_build_target.yml
uses: .github/workflows/_build_target.yml
strategy:
matrix:
target: [x86_64-unknown-linux-gnu, x86_64-apple-darwin]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:

build-targets:
name: Build targets
uses: ./.github/workflows/_build_target.yml
uses: .github/workflows/_build_target.yml
strategy:
matrix:
target: [x86_64-unknown-linux-gnu, x86_64-apple-darwin]
Expand Down

0 comments on commit fa6dd27

Please sign in to comment.