-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: use Inkscape to make the resume and add a CI to automatically g…
…enerate the PDF (#4)
- Loading branch information
1 parent
4bcdf85
commit 696b096
Showing
7 changed files
with
1,480 additions
and
17 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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
change-template: '- $TITLE @$AUTHOR (#$NUMBER)' | ||
template: | | ||
## What’s Changed | ||
$CHANGES |
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/usr/bin/env bash | ||
|
||
if gh release view "$(date --utc +'%y.%m')-1" >&2; then | ||
current_release="$(gh api '/repos/{owner}/{repo}/releases' | jq -r -c 'map(select(.draft == false and .prerelease == false)) | .[0].tag_name')" | ||
current_release_major_minor="$(echo $current_release | sed -e 's/^\(.*\)-.*/\1/')" | ||
current_release_version="$(echo $current_release | sed -e 's/^.*-\(.*\)/\1/')" | ||
>&2 echo "Found existing release for $current_release_major_minor: $current_release" | ||
else | ||
current_release_major_minor="$(date --utc +'%y.%m')" | ||
current_release_version=0 | ||
>&2 echo "No release found for $current_release_major_minor" | ||
fi | ||
|
||
new_version=$((current_release_version + 1)) | ||
new_release="$current_release_major_minor-$new_version" | ||
>&2 echo "New release: $new_release" | ||
echo "$new_release" |
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 |
---|---|---|
@@ -0,0 +1,83 @@ | ||
name: PDF Generation | ||
concurrency: | ||
group: ${{ github.ref }} | ||
cancel-in-progress: ${{ github.event_name == 'pull_request' }} | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: {} | ||
|
||
jobs: | ||
get-changed-files: | ||
name: Get Changed Files | ||
runs-on: ubuntu-20.04 | ||
outputs: | ||
changed-files: ${{ steps.changed-files.outputs.all_changed_and_modified_files }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 2 | ||
- name: Get list of all changes | ||
uses: tj-actions/changed-files@v26 | ||
id: changed-files | ||
|
||
build-pdf: | ||
name: Build Resume PDF | ||
runs-on: ubuntu-22.04 | ||
needs: [get-changed-files] | ||
if: contains(needs.get-changed-files.outputs.changed-files, 'src/Resume.svg') | ||
steps: | ||
- name: Checkout Repo | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 2 | ||
- name: Export resume SVG to PDF | ||
uses: docker://docker.io/minidocks/inkscape | ||
with: | ||
args: src/Resume.svg --export-filename=Resume.pdf | ||
- name: Upload Artifact to Job | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: Resume.pdf | ||
path: Resume.pdf | ||
|
||
publish-pdf: | ||
name: Publish Resume PDF | ||
runs-on: ubuntu-22.04 | ||
needs: [build-pdf] | ||
if: github.event_name == 'push' && github.ref == 'refs/heads/main' | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
steps: | ||
- name: Checkout Repo | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 2 | ||
- name: Bump PDF Version | ||
id: bump-version | ||
run: | | ||
new_version="$(./.github/scripts/bump_version.sh)" | ||
echo "::set-output name=new-version::$new_version" | ||
- name: Create Release | ||
uses: release-drafter/release-drafter@v5 | ||
id: create-release | ||
with: | ||
tag: ${{ steps.bump-version.outputs.new-version }} | ||
name: ${{ steps.bump-version.outputs.new-version }} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Download Artifact from Previous Job | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: Resume.pdf | ||
- name: Upload Release Asset | ||
run: | | ||
mv Resume.pdf Resume-${{ steps.bump-version.outputs.new-version }}.pdf | ||
until gh release view ${{ steps.bump-version.outputs.new-version }}; do | ||
echo "Release ${{ steps.bump-version.outputs.new-version }} not found. Waiting 1 second until checking again..." | ||
sleep 1 | ||
done | ||
gh release upload ${{ steps.bump-version.outputs.new-version }} Resume-${{ steps.bump-version.outputs.new-version }}.pdf | ||
- name: Publish Release | ||
run: gh release edit ${{ steps.bump-version.outputs.new-version }} --draft=false |
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 |
---|---|---|
|
@@ -2,3 +2,4 @@ | |
.idea | ||
auxil | ||
out | ||
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Resume | ||
|
||
This version of the resume is made using Inkscape. The source SVG is committed to this repo and a PDF is automatically | ||
generated by the CI system. | ||
|
||
When a pull request is opened, the source file is tested by doing a simple build test and | ||
the output of this test (a PDF) is added as an artifact to the build. | ||
|
||
When a commit is pushed to `main` (e.g. when a pull request is merged), the PDF is built and uploaded as an asset | ||
to a GitHub release in the repo. The versioning uses a modified [CalVer](https://calver.org/) versioning scheme in the | ||
form of `YY.MM-PATCH`. | ||
|
||
![Resume](./src/Resume.svg) |
Oops, something went wrong.