Skip to content

Commit

Permalink
Use nix in release pipeline; Add Linux releases
Browse files Browse the repository at this point in the history
  • Loading branch information
thmshmm committed May 5, 2024
1 parent 6c1d5d6 commit a2e9fec
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 20 deletions.
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')
9 changes: 8 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,14 @@

pkgs = import nixpkgs { inherit system overlays; };

toolchain = pkgs.rust-bin.stable."1.78.0".default;
toolchain = pkgs.rust-bin.stable."1.78.0".default.override {
targets = [
"x86_64-apple-darwin"
"aarch64-apple-darwin"
"x86_64-unknown-linux-gnu"
"aarch64-unknown-linux-gnu"
];
};

naersk' = pkgs.callPackage naersk {
cargo = toolchain;
Expand Down

0 comments on commit a2e9fec

Please sign in to comment.