Skip to content

Commit

Permalink
ci: minor edits to rust.yml, add macos build action
Browse files Browse the repository at this point in the history
  • Loading branch information
jtroo committed Dec 10, 2023
1 parent 905b038 commit 8baa460
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 6 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/macos-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: macos-build

on:
workflow_dispatch:
branches: [ "main" ]

env:
CARGO_TERM_COLOR: always
RUSTFLAGS: "-Dwarnings"

jobs:

build-macos:
runs-on: macos-latest

steps:
- uses: actions/checkout@v3
- uses: Swatinem/rust-cache@v2
with:
shared-key: "persist-cross-job"
workspaces: ./
- name: Build release
run: cargo build --release
- name: Move build artifact
shell: bash
run: |
mkdir -p artifacts
mv target/release/kanata artifacts/kanata_macos
- name: Build release with cmd feature
run: cargo build --release --features cmd
- name: Move build artifact with cmd feature
shell: bash
run: |
mv target/release/kanata artifacts/kanata_macos_cmd_allowed
- name: Strip binaries
shell: bash
run: |
strip artifacts/*
- uses: actions/upload-artifact@v3
with:
name: macos-binaries
path: |
artifacts/kanata_macos
artifacts/kanata_macos_cmd_allowed
10 changes: 4 additions & 6 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ on:
- keyberon/**/*
- cfg_samples/**/*
- parser/**/*
- test_cfgs/**/*
- .github/workflows/**/*
- .github/workflows/rust.yml
pull_request:
branches: [ "main" ]
paths:
Expand All @@ -19,8 +18,7 @@ on:
- keyberon/**/*
- parser/**/*
- cfg_samples/**/*
- test_cfgs/**/*
- .github/workflows/**/*
- .github/workflows/rust.yml

env:
CARGO_TERM_COLOR: always
Expand All @@ -39,7 +37,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
# You can add more, for any target you'd like!

include:
- build: linux
os: ubuntu-latest
Expand All @@ -52,7 +50,7 @@ jobs:
- build: macos
os: macos-latest
target: x86_64-apple-darwin

steps:
- uses: actions/checkout@v3
- uses: Swatinem/rust-cache@v2
Expand Down

0 comments on commit 8baa460

Please sign in to comment.