Skip to content

chapter 3: add details about apk and package versions #57

chapter 3: add details about apk and package versions

chapter 3: add details about apk and package versions #57

Workflow file for this run

name: Release
on:
push:
branches:
- main
paths:
- "src/**"
- "resources/**"
- "**.nix"
- ".github/workflows/*.yml"
jobs:
dependencies:
name: Build dependencies
runs-on: ubuntu-latest
outputs:
branch: ${{ steps.extract_branch.outputs.branch }}
steps:
- name: Check out source files
uses: actions/checkout@v4
- name: Extract branch name
shell: bash
run: echo "branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT
id: extract_branch
build:
name: Build PDF files
runs-on: ubuntu-latest
needs: [dependencies]
steps:
- name: Set git to use LF
run: |
git config --global core.autocrlf false
git config --global core.eol lf
- name: Check out source files
uses: actions/checkout@v4
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@main
- name: Build document
run: |
mkdir -p output
nix build .#thesis --out-link result-thesis --quiet
cp -vr --dereference $(readlink -f result-thesis) thesis
cp -ar thesis/* output/
- name: Upload build assets
uses: actions/upload-artifact@v4
with:
name: artefacts
path: output
assets:
name: Create release
runs-on: ubuntu-latest
needs: [dependencies, build]
steps:
- name: Download build assets (${{ matrix.assets.input }})
uses: actions/download-artifact@v4
- name: Rename files
working-directory: artefacts
run: |
for f in *.pdf; do cp ${f} ../$(printf '%s\n' "${{ github.run_number }}--${f%.pdf}--${{ github.sha }}.pdf"); done
- name: Create pre-release (v${{ github.run_number }}-${{ github.sha }})
id: create_release
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ github.run_number }}-${{ github.sha }}
name: Release ${{ github.run_number }} (${{ github.sha }})
draft: false
prerelease: true
files: |
./*.pdf