Repository navigation
53 lines (50 loc) · 1.68 KB
/
Copy pathreference-docs.yml
File metadata and controls
53 lines (50 loc) · 1.68 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
name: Reference documentation archive
# Attaches the generated Javadoc of a release to that release, as a tar.gz with its checksum, so the
# QTSurfer website can publish it. It runs after every release (see ci.yml) and by hand to build the
# archive of a release that already exists.
on:
workflow_call:
inputs:
tag:
description: Release tag to document
required: true
type: string
workflow_dispatch:
inputs:
tag:
description: Existing release tag to document
required: true
type: string
permissions:
contents: write
jobs:
archive:
runs-on: ubuntu-latest
env:
TAG: ${{ inputs.tag }}
GH_TOKEN: ${{ github.token }}
steps:
- name: Check that the release exists
run: gh release view "$TAG" --repo "$GITHUB_REPOSITORY" > /dev/null
- uses: actions/checkout@v4
with:
ref: refs/tags/${{ inputs.tag }}
- uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: 'maven'
# These sources are generated from the spec, so they have to exist before
# javadoc can read them.
- name: Generate javadoc
run: mvn -B generate-sources javadoc:javadoc
- name: Package the documentation
run: |
name="api-client-java-docs-${TAG}"
tar -czf "${name}.tar.gz" -C target/site/apidocs .
sha256sum "${name}.tar.gz" > "${name}.tar.gz.sha256"
- name: Attach it to the release
run: |
name="api-client-java-docs-${TAG}"
gh release upload "$TAG" "${name}.tar.gz" "${name}.tar.gz.sha256" \
--repo "$GITHUB_REPOSITORY" --clobber