-
Notifications
You must be signed in to change notification settings - Fork 0
104 lines (85 loc) · 2.85 KB
/
release.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
name: Build and release
on:
push:
paths:
- 'data/*.toml'
- 'src/*.tex'
- '.github/workflows/release.yaml'
env:
my_name: jonathan-zhang
jobs:
build-pdf:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
- name: Setup Texlive Environment
uses: teatimeguest/setup-texlive-action@9e499ca3d7c0a853ef08ccfd7e2a545b77d3959b # 3.3.0
with:
package-file: DEPENDS.txt
- name: Setup Python
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # 5.2.0
with:
python-version: "3.11"
- name: Build PDFs
run: python build.py
- name: Upload PDFs
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874
with:
name: "pdfs"
path: ".build/*.pdf"
generate-image:
needs: build-pdf
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
- name: Download PDFs
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16
with:
name: "pdfs"
- name: Setup Python
uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # 5.2.0
with:
python-version: "3.11"
- name: Install dependencies
run: python -m pip install -r requirements.txt
- name: Create PNG
# Adjust this to whichever resume you want to display
run: python -m pdf2png anon-*-backend-python.pdf main.png
- name: Upload PNG
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874
with:
name: "pngs"
path: "main.png"
release:
needs: generate-image
runs-on: ubuntu-latest
steps:
- name: Get timestamp and date
# funny timestamp format since git tags do not allow ':'
run: echo "timestamp=$(date +'%Y-%m-%dT%H-%MZ' --utc)" >> "$GITHUB_ENV"
- name: Checkout Repo
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
- name: Tag this commit
run: |
git --version
git config user.name "GH Actions"
git config user.email "<>"
git status
git tag -a $timestamp -m $timestamp
git push origin $timestamp
git describe
- name: Download PDFs
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16
with:
name: "pdfs"
- name: Download PNGs
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16
with:
name: "pngs"
- name: Release
run: |
gh release create --title $timestamp --generate-notes $timestamp *.pdf main.png
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}