Add github action to build release tags (#3449)
* Build release tags of the spec * Update .github/workflows/main.yml Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com> * Move historical (future old) job out to its own thing * Update for new baseurl setup * Use hugo config overrides instead * Remove mistakenly re-added matrix.org poke * Restore npm stuff to main branch representations * [2] Restore npm stuff to main branch representations * Update .github/workflows/main.yml Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com> Co-authored-by: Andrew Morgan <1342360+anoadragon453@users.noreply.github.com> Co-authored-by: Richard van der Hoff <1389908+richvdh@users.noreply.github.com>
This commit is contained in:
parent
5ea6d5610f
commit
aa31247165
1 changed files with 44 additions and 1 deletions
45
.github/workflows/main.yml
vendored
45
.github/workflows/main.yml
vendored
|
@ -3,6 +3,8 @@ on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
|
tags:
|
||||||
|
- v*
|
||||||
pull_request:
|
pull_request:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
|
@ -47,12 +49,18 @@ jobs:
|
||||||
npm i
|
npm i
|
||||||
npm run get-proposals
|
npm run get-proposals
|
||||||
|
|
||||||
# for PRs, set the baseURL to `/`. Otherwise, set it to `/unstable`.
|
# For PRs, set the baseURL to `/`.
|
||||||
|
# For releases, set the baseURL to `/$tag` (eg: `/v1.2`).
|
||||||
|
# Otherwise, set it to `/unstable`.
|
||||||
- name: "⚙️ Calculate baseURL"
|
- name: "⚙️ Calculate baseURL"
|
||||||
id: set-baseurl
|
id: set-baseurl
|
||||||
|
# Double brackets on the elif to avoid auto-escaping refs/tags/* because we need
|
||||||
|
# the asterisk matching behaviour, not the literal string.
|
||||||
run: |
|
run: |
|
||||||
if [ "${GITHUB_EVENT_NAME}" == "pull_request" ]; then
|
if [ "${GITHUB_EVENT_NAME}" == "pull_request" ]; then
|
||||||
echo ::set-output name=baseURL::/
|
echo ::set-output name=baseURL::/
|
||||||
|
elif [[ "${GITHUB_REF}" == refs/tags/* ]]; then
|
||||||
|
echo ::set-output name=baseURL::"/${GITHUB_REF/refs\/tags\//}"
|
||||||
else
|
else
|
||||||
echo ::set-output name=baseURL::/unstable
|
echo ::set-output name=baseURL::/unstable
|
||||||
fi
|
fi
|
||||||
|
@ -66,3 +74,38 @@ jobs:
|
||||||
with:
|
with:
|
||||||
name: spec-artifact
|
name: spec-artifact
|
||||||
path: spec.tar.gz
|
path: spec.tar.gz
|
||||||
|
|
||||||
|
build-historical-spec:
|
||||||
|
name: "📖 Build the historical backup spec"
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
if: ${{ startsWith(github.ref, 'refs/tags/') }}
|
||||||
|
steps:
|
||||||
|
- name: "➕ Setup Node"
|
||||||
|
uses: actions/setup-node@v2
|
||||||
|
with:
|
||||||
|
node-version: '14'
|
||||||
|
- name: "➕ Setup Hugo"
|
||||||
|
uses: peaceiris/actions-hugo@c03b5dbed22245418539b65eb9a3b1d5fdd9a0a6
|
||||||
|
with:
|
||||||
|
hugo-version: '0.85.0'
|
||||||
|
extended: true
|
||||||
|
- name: "📥 Source checkout"
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
submodules: 'recursive'
|
||||||
|
- name: "⚙️ npm"
|
||||||
|
run: |
|
||||||
|
npm i
|
||||||
|
npm run get-proposals
|
||||||
|
- name: "⚙️ hugo"
|
||||||
|
# Create a baseURL like `/v1.2` out of the `v1.2` tag
|
||||||
|
run: |
|
||||||
|
echo -e '[params.version]\nstatus="historical"' > historical.toml
|
||||||
|
hugo --config config.toml,historical.toml --baseURL "/${GITHUB_REF/refs\/tags\//}" -d "spec"
|
||||||
|
- name: "📦 Tarball creation"
|
||||||
|
run: tar -czf spec-historical.tar.gz spec
|
||||||
|
- name: "📤 Artifact upload"
|
||||||
|
uses: actions/upload-artifact@v2
|
||||||
|
with:
|
||||||
|
name: spec-historical-artifact
|
||||||
|
path: spec-historical.tar.gz
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue