-
Notifications
You must be signed in to change notification settings - Fork 141
88 lines (72 loc) · 2.46 KB
/
release.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
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
name: Release
on:
workflow_dispatch:
release:
types: [released]
jobs:
generate_docs:
runs-on: ubuntu-22.04
steps:
- name: checkout
uses: actions/checkout@v4
- name: Build documentation
run: |
bazel build //deploy:jazzer-docs //deploy:jazzer-api-docs //deploy:jazzer-junit-docs
cp $(bazel cquery --output=files //deploy:jazzer-docs) ./jazzer-docs.jar
cp $(bazel cquery --output=files //deploy:jazzer-api-docs) ./jazzer-api-docs.jar
cp $(bazel cquery --output=files //deploy:jazzer-junit-docs) ./jazzer-junit-docs.jar
- name: Upload jars
uses: actions/upload-artifact@v4
with:
name: jazzer_docs_jars
path: |
jazzer-docs.jar
jazzer-api-docs.jar
jazzer-junit-docs.jar
if-no-files-found: error
update_docs:
runs-on: ubuntu-22.04
needs: generate_docs
environment:
name: Deploy
steps:
- name: checkout docs
uses: actions/checkout@v4
with:
repository: 'CodeIntelligenceTesting/jazzer-docs'
ssh-key: "${{ secrets.JAZZER_DOCS_SSH_KEY_PRIVATE }}"
- name: Download jar
uses: actions/download-artifact@v4
with:
name: jazzer_docs_jars
path: .
- name: Setup git
run: |
git config user.email "[email protected]"
git config user.name "Jazzer release pipeline"
- name: Extract API docs jar
run: |
git rm -rf jazzer-api
mkdir jazzer-api
unzip jazzer-api-docs.jar -d jazzer-api
git add jazzer-api
# Do not fail if no changes to commit
# https://stackoverflow.com/questions/8123674/how-to-git-commit-nothing-without-an-error
git diff-index --quiet HEAD || git commit -m "Automated update: jazzer-api docs"
- name: Extract Jazzer docs jar
run: |
git rm -rf jazzer
mkdir jazzer
unzip jazzer-docs.jar -d jazzer
git add jazzer
git diff-index --quiet HEAD || git commit -m "Automated update: jazzer docs"
- name: Extract JUnit docs jar
run: |
git rm -rf jazzer-junit
mkdir jazzer-junit
unzip jazzer-junit-docs.jar -d jazzer-junit
git add jazzer-junit
git diff-index --quiet HEAD || git commit -m "Automated update: jazzer-junit docs"
- name: Push changes
run: |
git push