Skip to content

Commit

Permalink
Merge pull request #2 from thmshmm/feature/nix-build
Browse files Browse the repository at this point in the history
Feature/nix build
  • Loading branch information
thmshmm authored May 5, 2024
2 parents cdf5c43 + a2e9fec commit c63f883
Show file tree
Hide file tree
Showing 7 changed files with 338 additions and 114 deletions.
13 changes: 8 additions & 5 deletions .github/workflows/build-test-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,14 @@ jobs:
build-test-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v25
- name: Build
run: cargo build
run: |
nix build
- name: Test
run: cargo test
run: |
nix develop --ignore-environment --command "cargo" "test"
- name: Lint
run: cargo clippy

run: |
nix develop --ignore-environment --command "cargo" "clippy"
33 changes: 14 additions & 19 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,37 +16,32 @@ jobs:
matrix:
platform:
- release_for: macOS-x86_64
os: macOS-latest
os: macos-latest
target: x86_64-apple-darwin
bin: taskui
name: taskui-Darwin-x86_64.tar.gz
command: both
- release_for: macOS-aarch64
os: macOS-latest
os: macos-latest
target: aarch64-apple-darwin
bin: taskui
name: taskui-Darwin-aarch64.tar.gz
command: build
- release_for: Linux-x86_64
os: ubuntu-latest
target: x86_64-unknown-linux-gnu
- release_for: Linux-aarch64
os: ubuntu-latest
target: aarch64-unknown-linux-gnu
runs-on: ${{ matrix.platform.os }}
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- uses: cachix/install-nix-action@v25
- name: Build binary
uses: houseabsolute/actions-rust-cross@v0
with:
command: ${{ matrix.platform.command }}
target: ${{ matrix.platform.target }}
args: "--locked --release"
strip: true
run: |
nix build
- name: Archive
shell: bash
run: |
cd target/${{ matrix.platform.target }}/release
tar czvf ../../../${{ matrix.platform.name }} ${{ matrix.platform.bin }}
cd -
tar czvf taskui-${{ matrix.platform.target }}.tar.gz -h -C result/bin taskui
if: startsWith(github.ref, 'refs/tags/v')
- name: Release
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
with:
files: "taskui-*.tar.gz"
if: startsWith(github.ref, 'refs/tags/v')
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
/target
target/
result
.direnv/
.envrc
Loading

0 comments on commit c63f883

Please sign in to comment.