-
Notifications
You must be signed in to change notification settings - Fork 41
61 lines (46 loc) · 1.79 KB
/
run-gen-doc-when-dispatch.yml
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
name: Run Plugin
on:
repository_dispatch:
types: [run-plugin]
jobs:
use-artifact:
runs-on: ubuntu-latest
steps:
- name: Checkout Example Repository
uses: actions/checkout@v4
with:
ref: master
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
- name: Build and Install Plugin
run: mvn -DskipTests=true install
- name: Set Artifact URL
run: |
ARTIFACT_ID="${{ github.event.client_payload.artifact_id }}"
if [ -z "$ARTIFACT_ID" ]; then
echo "Error: ARTIFACT_ID is not set."
exit 1
fi
ARTIFACT_URL="https://api.github.com/repos/TongchengOpenSource/smart-doc/actions/artifacts/${ARTIFACT_ID}/zip"
echo "artifact_url=$ARTIFACT_URL" >> $GITHUB_ENV
- name: Download Artifact
run: |
echo "Downloading artifact from ${{ env.artifact_url }}"
curl -L -o smart-doc-maven-jar.zip -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" "${{ env.artifact_url }}"
- name: Create Directory and Move File
run: |
mkdir -p ~/.m2/repository/com/ly/smart-doc
mv smart-doc-maven-jar.zip ~/.m2/repository/com/ly/smart-doc/
echo "Listing files in target directory:"
ls -lh ~/.m2/repository/com/ly/smart-doc
- name: Unzip Artifact
run: |
unzip -o -d ~/.m2/repository/com/ly/smart-doc ~/.m2/repository/com/ly/smart-doc/smart-doc-maven-jar.zip || (echo "Unzip failed" && exit 1)
ls -lh ~/.m2/repository/com/ly/smart-doc
- name: Build and Install Plugin Again
run: mvn -DskipTests=true install
- name: Generate doc
run: mvn -DskipTests=true smart-doc:html