Repository navigation
79 lines (74 loc) · 2.17 KB
/
Copy pathci.yml
File metadata and controls
79 lines (74 loc) · 2.17 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
name: CI
on:
push:
branches: [main]
tags: ['[0-9]*.[0-9]*.[0-9]*']
pull_request:
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: 'maven'
- run: mvn -B verify
release:
needs: build
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Create GitHub Release
env:
GH_TOKEN: ${{ github.token }}
run: |
awk "/^## \[${GITHUB_REF_NAME}\]/{found=1; next} found && /^## \[/{exit} found{print}" \
CHANGELOG.md > /tmp/release-notes.md
gh release create "$GITHUB_REF_NAME" \
--title "$GITHUB_REF_NAME" \
--notes-file /tmp/release-notes.md
# Attaches the generated documentation to the release, for the QTSurfer website to publish.
reference-docs:
needs: release
if: startsWith(github.ref, 'refs/tags/')
permissions:
contents: write
uses: ./.github/workflows/reference-docs.yml
with:
tag: ${{ github.ref_name }}
docs:
needs: build
runs-on: ubuntu-latest
# Only tagged versions get published, so the site always describes a release
# rather than whatever main happens to be.
if: startsWith(github.ref, 'refs/tags/')
permissions:
contents: read
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deploy.outputs.page_url }}
steps:
- uses: actions/checkout@v4
- 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
- uses: actions/configure-pages@v5
- uses: actions/upload-pages-artifact@v3
with:
path: target/site/apidocs
- id: deploy
uses: actions/deploy-pages@v4