Repository navigation
126 lines (106 loc) · 3.92 KB
/
Copy pathrelease.yml
File metadata and controls
126 lines (106 loc) · 3.92 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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
name: release
on:
push:
tags:
- '**'
env:
GRADLE_OPTS: "-Dorg.gradle.jvmargs=-Xmx4g -Dorg.gradle.daemon=false -Dkotlin.incremental=false"
permissions:
contents: read
jobs:
publish-artifacts:
runs-on: macos-latest
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
- uses: actions/setup-java@v6
with:
distribution: 'zulu'
java-version-file: .github/workflows/.java-version
- name: Setup Xcode
uses: maxim-lobanov/setup-xcode@ed7a3b1fda3918c0306d1b724322adc0b8cc0a90 # v1
with:
xcode-version: latest-stable
# The publish plugin skips the Central Portal for a snapshot version. So a tag on a commit
# that still carries the snapshot version publishes nothing, and the job stays green. Fail
# here instead, and say what is wrong.
- name: Check the tag matches the project version
run: |
VERSION=$(sed -n 's/^VERSION_NAME=//p' gradle.properties)
if [ "$GITHUB_REF_NAME" != "$VERSION" ]; then
echo "Tag $GITHUB_REF_NAME does not match VERSION_NAME $VERSION in gradle.properties." >&2
echo "Set the version in gradle.properties, then move the tag onto that commit." >&2
exit 1
fi
# We set `SDKROOT` as a workaround for https://github.com/gradle/gradle/pull/29227
- name: Upload Artifacts
run: |
SDKROOT=$(xcrun -sdk macosx --show-sdk-path) ./gradlew publish --stacktrace --warning-mode all --no-daemon
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_CENTRAL_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_CENTRAL_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.GPG_SECRET_KEY }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.GPG_SECRET_PASSPHRASE }}
# We set `SDKROOT` as a workaround for https://github.com/gradle/gradle/pull/29227
- name: Publish plugin to Gradle portal
run: |
SDKROOT=$(xcrun -sdk macosx --show-sdk-path) ./gradlew publishPluginToGradlePortalIfRelease --stacktrace --warning-mode all
env:
GRADLE_PUBLISH_KEY: ${{ secrets.GRADLE_PUBLISH_KEY }}
GRADLE_PUBLISH_SECRET: ${{ secrets.GRADLE_PUBLISH_SECRET }}
# This job runs third-party Python packages, so it gets no secrets. The next job deploys the
# site that it builds.
build-website:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v7
with:
fetch-depth: 0
persist-credentials: false
- uses: actions/setup-java@v6
with:
distribution: 'zulu'
java-version-file: .github/workflows/.java-version
- name: Set up Python
uses: actions/setup-python@v7
with:
python-version: 3.14
- name: Prepare docs
run: .buildscript/prepare_mkdocs.sh
- name: Build mkdocs
run: |
pip3 install -r .github/workflows/mkdocs-requirements.txt
mkdocs build
- name: Upload site
uses: actions/upload-artifact@v7
with:
name: site
path: site
include-hidden-files: true
if-no-files-found: error
publish-website:
needs: build-website
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v7
with:
fetch-depth: 0
persist-credentials: false
- name: Download site
uses: actions/download-artifact@v8
with:
name: site
path: site
- name: Deploy docs
if: success()
uses: JamesIves/github-pages-deploy-action@132898c54c57c7cc6b80eb3a89968de8fc283505 # releases/v3
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages
FOLDER: site
SINGLE_COMMIT: true