-
Notifications
You must be signed in to change notification settings - Fork 1
103 lines (98 loc) · 3.5 KB
/
Copy pathdocs.yml
File metadata and controls
103 lines (98 loc) · 3.5 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
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
name: docs
# Publishes the library family to libtmux.org. Each language owns its
# prefix, with trunk at latest and each release tag at its own version
# plus next (prerelease) or stable (release).
#
# libtmux/docs builds and publishes the tree, through two reusable workflows
# pinned to one commit: port-docs.yml decides which versions an event builds
# and builds each from this repository's source, and reusable-deploy.yml
# publishes them. Bump both pins together.
on:
pull_request:
push:
branches: [master]
tags: ['v*']
workflow_dispatch:
inputs:
language:
description: Library to publish; all includes the parent and wrappers
required: true
type: choice
options: [all, java, kotlin, scala]
default: all
source-ref:
description: Exact source ref to build
required: true
default: master
version:
description: URL version slug
required: true
default: latest
version-kind:
description: Version policy
required: true
type: choice
options: [trunk, tag, alias]
default: trunk
is-default:
description: Make this version canonical
required: true
type: boolean
default: false
resolves-to:
description: Immutable target for an alias
required: false
default: ''
publish:
description: Publish after the exact build passes
required: true
type: boolean
default: false
permissions:
contents: read
jobs:
# A pull request builds `latest` without publishing; this port has no
# preview role.
build:
uses: libtmux/docs/.github/workflows/port-docs.yml@9d7d9713156ada4908bca0151e2ff1619c05daf7
with:
port: ${{ inputs.language && inputs.language != 'all' && inputs.language || 'java' }}
include-wrappers: ${{ inputs.language == '' || inputs.language == 'all' }}
source-ref: ${{ inputs.source-ref }}
version: ${{ inputs.version }}
version-kind: ${{ inputs.version-kind }}
is-default: ${{ inputs.is-default == true }}
resolves-to: ${{ inputs.resolves-to }}
publish: ${{ inputs.publish == true }}
# Serialize versions of one language because they share its manifest.
# Sibling languages have separate prefixes and may publish concurrently.
# Queue every publication so a newer run cannot drop a release tag.
publish:
needs: build
if: needs.build.outputs.should-publish == 'true'
concurrency:
group: docs-deploy-${{ github.repository }}-${{ matrix.port }}
queue: max
strategy:
fail-fast: false
matrix: ${{ fromJSON(needs.build.outputs.matrix) }}
permissions:
contents: read
id-token: write
uses: libtmux/docs/.github/workflows/reusable-deploy.yml@9d7d9713156ada4908bca0151e2ff1619c05daf7
with:
# Unprefixed by locale: reusable-deploy prepends <locale>/ itself when
# `port` is set, so each language gets its own version tree.
path-prefix: ${{ matrix.port }}/${{ matrix.version }}
artifact: docs-${{ matrix.port }}-${{ matrix.version }}
version-kind: ${{ matrix.kind }}
port: ${{ matrix.port }}
version: ${{ matrix.version }}
label: ${{ matrix.version }}
is-default: ${{ matrix.isDefault }}
resolves-to: ${{ matrix.resolvesTo }}
environment: docs
secrets:
role-arn: ${{ secrets.LIBTMUX_DOCS_ROLE_ARN }}
bucket: ${{ secrets.LIBTMUX_DOCS_BUCKET }}
distribution: ${{ secrets.LIBTMUX_DOCS_DISTRIBUTION }}