Skip to content

Commit

Permalink
Merge pull request gravwell#117 from michael-wisely-gravwell/build-an…
Browse files Browse the repository at this point in the history
…d-release

Build / CI: Add default.nix and update build workflow
  • Loading branch information
ashnwade authored Aug 28, 2024
2 parents 643d93c + 9e1e52e commit d7191fb
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 18 deletions.
18 changes: 0 additions & 18 deletions .github/workflows/pdfbuilder.yml

This file was deleted.

33 changes: 33 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Release

on:
push:
tags:
- "v*"

jobs:
training-pdf-builder:
runs-on: ubuntu-latest
name: Build the training PDF and Release
steps:
- name: Checkout source
uses: actions/checkout@v4

- name: Setup Nix
uses: cachix/install-nix-action@v25
with:
nix_path: nixpkgs=channel:nixos-unstable

- name: Build PDF
run: |
nix-build
- name: Update PDF name
run: |
cp result/master.pdf gravwell_training_${{ github.ref_name }}.pdf
- name: Publish
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create ${{ github.ref_name }} gravwell_training_${{ github.ref_name }}.pdf --verify-tag --generate-notes
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ gravwell_training.tgz
*.ilg
*.ind
*.tgz
result
20 changes: 20 additions & 0 deletions default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
let
pkgs = import (fetchTarball
"https://github.com/NixOS/nixpkgs/archive/a6292e34000dc93d43bccf78338770c1c5ec8a99.tar.gz")
{ };

in pkgs.stdenv.mkDerivation {
name = "Gravwell Training";
src = ./.;

buildInputs = [ pkgs.texlive.combined.scheme-full ];

buildPhase = ''
make master.pdf
'';

installPhase = ''
mkdir $out
cp master.pdf $out
'';
}

0 comments on commit d7191fb

Please sign in to comment.