Skip to content

Commit

Permalink
Produce GitHub actions artifacts
Browse files Browse the repository at this point in the history
  • Loading branch information
siraben committed Nov 1, 2020
1 parent e1f857f commit 4ab0e10
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: 'nix-remarkable'
on:
pull_request:
push:
jobs:
tests:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- uses: cachix/install-nix-action@v11
with:
nix_path: nixpkgs=channel:nixos-unstable
- run: nix build
- name: "Copy ti84-forth"
run: "mkdir ti84-forth && cp -r result/* ti84-forth && chmod +w -R ti84-forth"
- name: "Upload artifact to github"
uses: actions/upload-artifact@v2
with:
name: ti84-forth
path: ti84-forth
21 changes: 21 additions & 0 deletions default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{ pkgs ? import <nixpkgs> {}}:
with pkgs;

let
spasm-ng = callPackage ./spasm-ng.nix {};
in

stdenv.mkDerivation {
name = "ti84-forth";
src = ./.;
nativeBuildInputs = [ spasm-ng ];

buildPhase = ''
spasm forth.asm forth.8xp
'';

installPhase = ''
mkdir -p $out/bin
mv forth.8xp $out/bin
'';
}
25 changes: 25 additions & 0 deletions spasm-ng.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{ stdenv, fetchFromGitHub, gcc, gmp, openssl, zlib }:

stdenv.mkDerivation rec {
pname = "spasm-ng";
version = "unstable-2020-08-03";

src = fetchFromGitHub {
owner = "alberthdev";
repo = "spasm-ng";
rev = "221898beff2442f459b80ab89c8e1035db97868e";
sha256 = "0xspxmp2fir604b4xsk4hi1gjv61rnq2ypppr7cj981jlhicmvjj";
};

nativeBuildInputs = [ gcc ];

buildInputs = [ gmp openssl zlib ];

enableParallelBuilding = true;

hardeningDisable = [ "fortify" ];

installPhase = ''
install -Dm755 spasm -t $out/bin
'';
}

0 comments on commit 4ab0e10

Please sign in to comment.