-
Notifications
You must be signed in to change notification settings - Fork 157
57 lines (56 loc) · 2.12 KB
/
publish_common.yml
File metadata and controls
57 lines (56 loc) · 2.12 KB
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
# Publish pre-3.0 specs (spec versions that do not require spec-parser)
# This workflow can be triggered manually or by a repository dispatch event.
# It has three parameters:
# - ref: The branch or tag to publish
# - as_version: The version to publish as
# - aliases: Space-delimited aliases
#
# For example, to publish the "support/2.3.1" branch (under development)
# as "v2.3.1-dev" with aliases "v2.3.1", "2.3.1", and "2.3.1-dev",
# you can trigger the workflow with:
# - ref = "refs/heads/support/2.3.1"
# - as_version = "v2.3.1-dev"
# - aliases = "v2.3.1 2.3.1 2.3.1-dev"
on:
repository_dispatch:
types:
- publish_spec
workflow_dispatch:
inputs:
ref:
description: Branch or tag to publish (e.g. refs/heads/support/2.3).
required: true
default: refs/heads/support/2.3
as_version:
description: Version to publish as (e.g. v2.3).
required: true
default: v2.3
aliases:
description: Space-delimited aliases to publish (e.g. v2-latest v2-draft).
required: false
jobs:
build:
runs-on: ubuntu-latest
container: python:3.12
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd #v6.0.2
with:
ref: ${{ github.event.client_payload.ref || github.event.inputs.ref }}
path: spdx-spec
fetch-depth: 0 # Because we will be pushing the gh-pages branch
- name: Install pre-requisites
run: pip install json-schema-for-humans==1.4.1 mike==2.1.3 mkdocs==1.6.1
- name: Generate schema doc
working-directory: spdx-spec
run: generate-schema-doc schemas/spdx-schema.json chapters/spdx-json-schema.html
- name: Set Git identity
working-directory: spdx-spec
run: |
git config user.name github-actions
git config user.email github-actions@github.com
- name: Build docs
working-directory: spdx-spec
env:
AS_VERSION: ${{ github.event.client_payload.as_version || github.event.inputs.as_version }}
run: |
mike deploy --update-aliases --push $AS_VERSION ${{ github.event.client_payload.as_version || github.event.inputs.as_version }}