-
Notifications
You must be signed in to change notification settings - Fork 0
111 lines (93 loc) · 2.75 KB
/
build.yml
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
105
106
107
108
109
110
name: Generate PDF
on:
push:
branches:
- '*'
tags:
- 'v*'
pull_request:
branches:
- '*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y texlive-xetex wget alien inkscape \
texlive-lang-chinese fonts-noto-cjk
- name: Install fonts
run: |
sudo cp -r assets/courier/ /usr/share/fonts/courier/
- name: Make all
run: make ALL
- name: upload 4:3
uses: actions/[email protected]
with:
name: 4-3
path: /tmp/43/*.pdf
- name: upload 16:9
uses: actions/[email protected]
with:
name: 16-9
path: /tmp/169/*.pdf
release:
needs: build
runs-on: ubuntu-latest
if: ${{ (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/master' && github.event_name == 'push') }}
steps:
- uses: actions/[email protected]
- name: Download 4:3
uses: actions/[email protected]
with:
name: 4-3
path: 43/
- name: Download 16:9
uses: actions/[email protected]
with:
name: 16-9
path: 169/
- name: Zip
run: |
zip -r 4-3.zip 43/
zip -r 16-9.zip 169/
- name: Bump version and push tag
id: tag_version
uses: mathieudutour/[email protected]
with:
custom_tag: auto-release-${{ github.sha }}
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: auto-release-${{ github.sha }}
release_name: Auto Release ${{ github.sha }}
body: |
Automatically created by GitHub Actions
draft: false
prerelease: false
- name: Release 4:3
id: upload-release-asset-4-3
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./4-3.zip
asset_name: 4-3.zip
asset_content_type: application/zip
- name: Release 16:9
id: upload-release-asset-16-9
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./16-9.zip
asset_name: 16-9.zip
asset_content_type: application/zip