Skip to content

Commit 5e6c780

Browse files
authored
Move language spec upload from Github actions to cloud build: Add cloudbuild.yaml (#4323)
This PR adds a `cloudbuild.yaml` file to the language repository such that the generation of a PDF version of the language specification can be performed by a Google Cloud Build step. It also adds a `build_pdf` script which will download the required software and perform the actual PDF generation.
1 parent 70106d2 commit 5e6c780

File tree

3 files changed

+33
-0
lines changed

3 files changed

+33
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
steps:
2+
- name: 'ubuntu'
3+
args: ['specification/scripts/build_pdf']
4+
env:
5+
- 'BRANCH_NAME=$BRANCH_NAME'
6+
- '_PR_NUMBER=$_PR_NUMBER'
7+
- name: 'gcr.io/cloud-builders/gsutil'
8+
args: [ '-m', 'cp', '-r', 'specification/artifacts/*', 'gs://dart-specification']
9+
options:
10+
automapSubstitutions: true
11+
logging: CLOUD_LOGGING_ONLY

specification/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ dartLangSpec-terse.tex
1111
*-list.txt
1212
.dart_tool/
1313
.packages
14+
firebase/

specification/scripts/build_pdf

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/usr/bin/env -S bash --norc
2+
3+
set -ex
4+
5+
apt-get update -qq
6+
apt-get install -y --no-install-recommends \
7+
build-essential \
8+
texlive-latex-base \
9+
texlive-latex-extra \
10+
texlive-fonts-recommended \
11+
lmodern
12+
cd specification
13+
make
14+
mkdir -p artifacts
15+
if [ "$BRANCH_NAME" == "main" ]; then
16+
cp dartLangSpec.pdf artifacts/DartLangSpecDraft.pdf
17+
elif [ "$_PR_NUMBER" != "" ]; then
18+
mkdir -p artifacts/pr/$_PR_NUMBER
19+
cp dartLangSpec.pdf artifacts/pr/$_PR_NUMBER/DartLangSpecDraft.pdf
20+
fi
21+

0 commit comments

Comments
 (0)