-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
932 additions
and
649 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: | | ||
- 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: | | ||
Oops, something went wrong.