Skip to content

Commit

Permalink
cv: switch from LaTeX to Typst
Browse files Browse the repository at this point in the history
  • Loading branch information
drupol committed Oct 6, 2024
1 parent 4b732f3 commit 601ea18
Show file tree
Hide file tree
Showing 15 changed files with 932 additions and 649 deletions.
136 changes: 69 additions & 67 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,82 +1,84 @@
name: Build
name: Release

on: [push]
on:
push:
branches:
- master
paths:
- "src/**"
- "resources/**"
- "**.nix"
- ".github/workflows/*.yml"

jobs:
dependencies:
name: Build dependencies
runs-on: ubuntu-latest
outputs:
version: ${{ steps.version.outputs.version }}
dependencies:
name: Build dependencies
runs-on: ubuntu-latest
outputs:
branch: ${{ steps.extract_branch.outputs.branch }}

steps:
- name: Check out source files
uses: actions/checkout@v3
steps:
- name: Check out source files
uses: actions/checkout@v4

- name: Create global variables
id: version
run: echo "::set-output name=version::$(git rev-parse --short HEAD)"
- 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
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
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@v3
with:
fetch-depth: 1
- name: Check out source files
uses: actions/checkout@v4

- name: Create global variables
id: version
run: echo "::set-output name=version::$(git rev-parse --short HEAD)"
- name: Install Nix
uses: cachix/install-nix-action@v27

- name: Install Nix
uses: cachix/install-nix-action@v29
- name: Build document
run: |
mkdir -p output
nix build .#cv --out-link result-cv --quiet
cp -vr --dereference $(readlink -f result-cv) cv
cp -ar cv/* output/
- name: Build document
run: |
mkdir -p output
nix build . --out-link result-cv --quiet
cp -vr --dereference $(readlink -f result-cv) cv
cp -ar cv/* output/
- name: Upload build assets
uses: actions/upload-artifact@v4
with:
name: artefacts
path: output

- name: Upload build assets
uses: actions/upload-artifact@v4
with:
name: assets
path: output
assets:
name: Create release
runs-on: ubuntu-latest
needs: [dependencies, build]

release:
name: "Create tag/pre-release"
runs-on: ubuntu-latest
needs: [dependencies,build]
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:
- name: Download build assets (${{ matrix.assets.input }})
uses: actions/download-artifact@v4
steps:
- name: Download build assets (${{ matrix.assets.input }})
uses: actions/download-artifact@v4

- name: Rename files
working-directory: assets
run: |
for f in *.pdf; do cp ${f} ../$(printf '%s\n' "cv.pdf"); done
- name: Rename files
working-directory: artefacts
run: |
for f in *.pdf; do cp ${f} ../$(printf '%s\n' "cv.pdf"); done
- name: Create pre-release (${{ needs.dependencies.outputs.version }})
id: create_release
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ github.run_number }}-${{ needs.dependencies.outputs.version }}
name: Version ${{ github.run_number }} (${{ needs.dependencies.outputs.version }})
draft: false
prerelease: true
files: |
*.pdf
- 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
54 changes: 0 additions & 54 deletions Makefile

This file was deleted.

Loading

0 comments on commit 601ea18

Please sign in to comment.