-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathazure-pipelines.yml
129 lines (103 loc) · 4.02 KB
/
azure-pipelines.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
# Copyright 2022 the Tectonic Project
# Licensed under the MIT License
trigger:
- main
resources:
- repo: self
variables:
srcversion: '2022.0'
storage: 'ttassets'
jobs:
- job: Build
displayName: Build
pool:
vmImage: 'ubuntu-latest'
steps:
- checkout: self
- bash: |
set -xeuo pipefail
rustup set profile minimal
rustup component remove rust-docs || echo "already removed"
rustup update stable
rustup default stable
# Helpful versions
rustup -V
rustc -Vv
cargo -V
displayName: Set up Rust
- bash: cargo build --release
displayName: cargo build
- bash: |
set -xeuo pipefail
wget https://ctan.org/tex-archive/systems/knuth/dist/web/weave.web
displayName: Download weave source
- bash: |
set -xeuo pipefail
url="https://github.com/tectonic-typesetting/tectonic-staging/releases"
url="$url/download/texlive-${SRCVERSION}/tectonic-book-tl${SRCVERSION}.web"
wget -O xetex.web "$url"
displayName: Download xetex source
- bash: |
set -euo pipefail # note: `set -x` breaks ##vso echoes
d="$(mktemp -d /tmp/tectonic.XXXXXX)"
cd "$d"
curl --proto '=https' --tlsv1.2 -fsSL https://drop-sh.fullyjustified.net |sh
echo "##vso[task.prependpath]$d"
displayName: Install Tectonic
- bash: ./yarn.sh install
displayName: yarn install
# Build WEAVE
- bash: ./weave.sh weave.web
displayName: tt-weave (weave)
- bash: ./tectonic.sh
displayName: tectonic (weave)
- bash: ./yarn.sh build --public-url /weave/$(srcversion)/
displayName: yarn build (weave)
- bash: |
mv app/dist dist-weave
displayName: Move away output (weave)
- bash: |
rm -rf template/src/index.tex template/build app/src/ttw app/dist
displayName: Clean up (weave)
# Build XeTeX: A Pseudoprogram
- bash: ./weave.sh xetex.web
displayName: tt-weave (xap)
- bash: ./tectonic.sh
displayName: tectonic (xap)
- bash: ./yarn.sh build --public-url /xap/$(srcversion)/
displayName: yarn build (xap)
- bash: |
mv app/dist dist-xap
displayName: Move away output (xap)
- bash: |
rm -rf template/src/index.tex template/build app/src/ttw app/dist
displayName: Clean up (xap)
# Deploy, maybe
- ${{ if and(eq(variables['Build.SourceBranchName'], 'main'), ne(variables['build.reason'], 'PullRequest')) }}:
# Derived from https://www.ipannila.net/upload-to-blob-storage-from-azure-devops/
- task: AzureCLI@2
displayName: Deploy weave
inputs:
azureSubscription: "pkgw@AzureRM"
scriptType: bash
scriptLocation: inlineScript
addSpnToEnvironment: true
inlineScript: |
az config set extension.use_dynamic_install=yes_without_prompt
accountkey=$(az storage account keys list -n $(storage) --query="[0].value" -o tsv)
uploadtokenexpiry=$(date -u -d "30 minutes" '+%Y-%m-%dT%H:%MZ')
uploadsas=$(az storage container generate-sas -n '$web' --https-only --permissions rwl --expiry $uploadtokenexpiry -o tsv --account-name $(storage) --account-key $accountkey)
az storage azcopy blob upload --account-name $(storage) --sas-token $uploadsas -c '$web' -s 'dist-weave/*' -r -d _stacks/weave/$(srcversion)/
- task: AzureCLI@2
displayName: Deploy xap
inputs:
azureSubscription: "pkgw@AzureRM"
scriptType: bash
scriptLocation: inlineScript
addSpnToEnvironment: true
inlineScript: |
az config set extension.use_dynamic_install=yes_without_prompt
accountkey=$(az storage account keys list -n $(storage) --query="[0].value" -o tsv)
uploadtokenexpiry=$(date -u -d "30 minutes" '+%Y-%m-%dT%H:%MZ')
uploadsas=$(az storage container generate-sas -n '$web' --https-only --permissions rwl --expiry $uploadtokenexpiry -o tsv --account-name $(storage) --account-key $accountkey)
az storage azcopy blob upload --account-name $(storage) --sas-token $uploadsas -c '$web' -s 'dist-xap/*' -r -d _stacks/xap/$(srcversion)/