-
Notifications
You must be signed in to change notification settings - Fork 2
175 lines (148 loc) · 5.03 KB
/
ubuntu.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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
name: ubuntu
on:
push:
branches:
- master
pull_request:
concurrency:
group: '${{ github.workflow }}-${{ github.job }}-${{ github.head_ref || github.ref_name }}'
cancel-in-progress: true
jobs:
build:
name: ubuntu_build
runs-on: ubuntu-latest
outputs:
common_changed: ${{ steps.common-changed.outputs.only_changed }}
steps:
- uses: actions/checkout@v2
- id: common-changed
uses: tj-actions/[email protected]
with:
files: |
xslt_src/common.xsl
# cabextract for fonts, gettext-base for envsubst, libxml2-utils for xmllint
- name: Setup prerequisites
run: |
sudo apt-get update
sudo apt-get -y install gettext-base cabextract libxml2-utils curl \
software-properties-common gcc ruby ruby-dev libffi-dev make libxml2-dev libxslt1-dev libcurl4-gnutls-dev
- run: make update-init update-modules
- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.1
bundler-cache: true
- uses: actions/cache@v2
with:
path: ~/.fontist
key: fontist-ubuntu
restore-keys: fontist-ubuntu
- name: Install Fontist fonts
run: |
gem install fontist
fontist update
fontist manifest-install --confirm-license fonts/manifest.yml
fontist manifest-locations fonts/manifest.yml > fonts/manifest.paths.yml
cat fonts/manifest.paths.yml
- run: make all published
env:
GITHUB_USERNAME: ${{ github.actor }}
GITHUB_TOKEN: ${{ github.token }}
- uses: actions/upload-artifact@master
with:
name: published-ubuntu
path: published
- uses: actions/upload-artifact@master
with:
name: xslt
path: xslt
deploy-gh-pages:
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@master
- uses: actions/download-artifact@master
with:
name: published-ubuntu
path: published
- name: GitHub Pages action
uses: docker://peaceiris/gh-pages:v2
with:
emptyCommits: false
forceOrphan: true
env:
ACTIONS_DEPLOY_KEY: ${{ secrets.GH_DEPLOY_KEY }}
PUBLISH_BRANCH: gh-pages
PUBLISH_DIR: ./published
update-xslts:
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
needs: build
strategy:
fail-fast: false
matrix:
flavor: [csa, cc, iec, ieee, iho, iso, itu, jis, ogc, plateau, ribose] # gb, mpfa, m3aawg, un
include:
- flavor: bipm
prefix: '{bipm,jcgm}'
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@master
with:
name: xslt
path: xslt
- uses: actions/checkout@v3
with:
submodules: recursive
repository: metanorma/metanorma-${{ matrix.flavor }}
token: ${{ secrets.METANORMA_CI_PAT_TOKEN }}
path: ${{ github.workspace }}/metanorma-${{ matrix.flavor }}
- run: rsync xslt/${{ matrix.prefix || matrix.flavor }}.*.xsl ${{ github.workspace }}/metanorma-${{ matrix.flavor }}/lib/isodoc/${{ matrix.flavor }}/
- uses: peter-evans/create-pull-request@v4
id: cpr
with:
path: ${{ github.workspace }}/metanorma-${{ matrix.flavor }}
token: ${{ secrets.METANORMA_CI_PAT_TOKEN }}
add-paths: lib/isodoc/${{ matrix.flavor }}
branch: feature/xslt-update
delete-branch: true
reviewers: |
opoudjis
ronaldtse
title: xslt update based on metanorma/mn-native-pdf@${{ github.sha }}
commit-message: xslt update based on metanorma/mn-native-pdf@${{ github.sha }}
labels: automerge
- if: ${{ steps.cpr.outputs.pull-request-number }}
run: printf " - ${{ steps.cpr.outputs.pull-request-url }}\n" > pr-url.txt
- uses: actions/upload-artifact@v4
with:
name: pr-url-${{ matrix.flavor }}
path: pr-url.txt
update-private-xslts:
if: github.ref == 'refs/heads/master' && needs.build.outputs.common_changed == 'true'
runs-on: ubuntu-latest
needs: build
strategy:
fail-fast: false
matrix:
flavor: [bsi, nist]
steps:
- uses: peter-evans/repository-dispatch@v1
with:
token: ${{ secrets.METANORMA_CI_PAT_TOKEN }}
repository: metanorma/mn-native-pdf-${{ matrix.flavor }}
event-type: metanorma/mn-native-pdf
update-prs-list:
runs-on: ubuntu-latest
needs: update-xslts
steps:
- uses: actions/checkout@v3
- uses: actions/[email protected]
- run: cat pr-url-*/pr-url.txt >> .github/templates/prs-list.md
- uses: JasonEtco/create-an-issue@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
assignees: opoudjis, ronaldtse
update_existing: true
filename: .github/templates/prs-list.md