Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/nix build #2

Merged
merged 3 commits into from
May 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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