-
Notifications
You must be signed in to change notification settings - Fork 1
88 lines (77 loc) · 2.31 KB
/
build_fonts.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
# Builds fonts either when a prerelease version tag (e.g. v1.2-foo)
# is created, or when source is changed.
#
# When a version tag is created, a pre-release is automatically created.
#
# Otherwise, when source changes without a tag being created,
# the build artifacts are uploaded to github and saved for 1 day.
# They can be found at https://github.com/rsms/inter/actions/runs/RUNID
name: Build fonts
on:
push:
branches: [main]
paths:
- "src/**"
- Makefile
- requirements.txt
- version.txt
tags:
- "v*"
pull_request:
branches: [main]
paths:
- "src/**"
- Makefile
- requirements.txt
- version.txt
workflow_dispatch:
defaults:
run:
shell: bash
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v3
with:
python-version: '3.12'
- name: Install utilities
run: sudo apt-get install -y zip
- name: make init
run: make init
- name: Define version (tag)
if: startsWith(github.ref, 'refs/tags/v')
run: |
VERSION=${{ github.ref }}
VERSION=${VERSION:11} # refs/tags/v1.2.3 => 1.2.3
echo "novagothic_version=$VERSION" >> $GITHUB_ENV
- name: Define version (branch)
if: ${{ ! startsWith(github.ref, 'refs/tags/v') }}
run: |
GITSHA=${{ github.sha }}
VERSION=$(cat version.txt)
echo "novagothic_version=${VERSION}-${GITSHA:0:10}" >> $GITHUB_ENV
- name: make build
run: |
ZIP=NovaGothic-${{ env.novagothic_version }}.zip
echo "novagothic_zip=$ZIP" >> $GITHUB_ENV
make zip
mv NovaGothic.zip "$ZIP"
- name: Upload archive (unless tag)
if: ${{ ! startsWith(github.ref, 'refs/tags/v') }}
uses: actions/upload-artifact@v3
with:
path: ${{ env.novagothic_zip }}
retention-days: 1
- name: Create release (if tag)
if: startsWith(github.ref, 'refs/tags/v')
uses: softprops/action-gh-release@v1
with:
prerelease: true
name: "${{ env.novagothic_version }}"
body: "This release was created automatically"
files: ${{ env.novagothic_zip }}