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
name: "Deploy"
on:
workflow_call:
inputs:
is-dev:
required: true
type: boolean
is-release:
required: true
type: boolean
jobs:
update-book:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
- name: "Deployment Setup"
id: deploy-setup
uses: ./.github/actions/deploy-setup
with:
is-dev: ${{ inputs.is-dev }}
is-release: ${{ inputs.is-release }}
- name: "Update book HTML"
if: ${{ steps.deploy-setup.outputs.top-level != 'skip' }}
run: |
# Worth adding better Cranko support for this? reboot-branch is close
dist/force-push-tree.sh \
$GITHUB_WORKSPACE/book \
https://github.com/tectonic-typesetting/book.git \
"${{ steps.deploy-setup.outputs.top-level }}" \
"docs mdbook"
env:
GITHUB_TOKEN: ${{ secrets.BOOK_TOKEN }}
recreate-continuous:
runs-on: ubuntu-latest
if: ${{ inputs.is-dev }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
- name: "Deployment Setup"
id: deploy-setup
uses: ./.github/actions/deploy-setup
with:
is-dev: ${{ inputs.is-dev }}
is-release: ${{ inputs.is-release }}
setup-git: 'true'
- name: "Recreate continuous-deployment GitHub release"
run: |
# Allow this to fail, in case the release isn't present
cranko github delete-release continuous || true
git tag -f continuous HEAD
git push -f origin refs/tags/continuous
cranko github create-custom-release \
--name "Continuous Deployment" \
--prerelease \
--desc "Continuous deployment of commit $(git rev-parse --short HEAD)" \
continuous
cranko github upload-artifacts --by-tag continuous \
$GITHUB_WORKSPACE/binary-*/* \
$GITHUB_WORKSPACE/appimage/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
branch-and-tag:
runs-on: ubuntu-latest
if: ${{ inputs.is-release }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
- name: "Deployment Setup"
id: deploy-setup
uses: ./.github/actions/deploy-setup
with:
is-dev: ${{ inputs.is-dev }}
is-release: ${{ inputs.is-release }}
- name: "Tag and push"
run: |
cranko release-workflow tag
git push --tags origin release:release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
github-releases:
runs-on: ubuntu-latest
if: ${{ inputs.is-release }}
needs: branch-and-tag
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
- name: "Deployment Setup"
id: deploy-setup
uses: ./.github/actions/deploy-setup
with:
is-dev: ${{ inputs.is-dev }}
is-release: ${{ inputs.is-release }}
- name: "Create per-project GitHub releases"
run: |
cranko github create-releases
if cranko show if-released --exit-code tectonic; then
cranko github upload-artifacts tectonic \
$GITHUB_WORKSPACE/binary-*/* \
$GITHUB_WORKSPACE/appimage/*
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
cargo-publish:
runs-on: ubuntu-latest
if: ${{ inputs.is-release }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
- name: "Deployment Setup"
id: deploy-setup
uses: ./.github/actions/deploy-setup
with:
is-dev: ${{ inputs.is-dev }}
is-release: ${{ inputs.is-release }}
artifacts: 'false'
- name: "Publish updated Cargo crates"
run: cranko cargo foreach-released --pause=30 -- publish --no-verify --allow-dirty
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
update-website:
runs-on: ubuntu-latest
if: ${{ inputs.is-release }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: true
- name: "Deployment Setup"
id: deploy-setup
uses: ./.github/actions/deploy-setup
with:
is-dev: ${{ inputs.is-dev }}
is-release: ${{ inputs.is-release }}
setup-git: 'true'
- name: "Update GitHub Pages website"
if: ${{ steps.deploy-setup.outputs.top-level != 'skip' }}
run: bash dist/update-website.sh
env:
GITHUB_TOKEN: ${{ secrets.BOOK_TOKEN }}