Skip to content

Commit b1af4b5

Browse files
committed
Release script: Deploy docs on release
1 parent 8ffe8a6 commit b1af4b5

File tree

1 file changed

+79
-0
lines changed

1 file changed

+79
-0
lines changed

.github/workflows/release.yml

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,82 @@ jobs:
2020

2121
- name: Push docker containers
2222
run: docker/push_all.sh
23+
24+
generate_docs:
25+
runs-on: ubuntu-latest
26+
27+
steps:
28+
- name: checkout
29+
uses: actions/checkout@v3
30+
31+
- name: Build documentation
32+
run: |
33+
bazel build //deploy:jazzer-docs //deploy:jazzer-api-docs //deploy:jazzer-junit-docs
34+
cp $(bazel cquery --output=files //deploy:jazzer-docs) ./jazzer-docs.jar
35+
cp $(bazel cquery --output=files //deploy:jazzer-api-docs) ./jazzer-api-docs.jar
36+
cp $(bazel cquery --output=files //deploy:jazzer-junit-docs) ./jazzer-junit-docs.jar
37+
38+
- name: Upload jars
39+
uses: actions/upload-artifact@v3
40+
with:
41+
name: jazzer_docs_jars
42+
path: |
43+
jazzer-docs.jar
44+
jazzer-api-docs.jar
45+
jazzer-junit-docs.jar
46+
if-no-files-found: error
47+
48+
update_docs:
49+
runs-on: ubuntu-latest
50+
needs: generate_docs
51+
52+
environment:
53+
name: Deploy
54+
55+
steps:
56+
- name: checkout docs
57+
uses: actions/checkout@v3
58+
with:
59+
repository: 'CodeIntelligenceTesting/jazzer-docs'
60+
ssh-key: "${{ secrets.JAZZER_DOCS_SSH_KEY_PRIVATE }}"
61+
62+
- name: Download jar
63+
uses: actions/download-artifact@v3
64+
with:
65+
name: jazzer_docs_jars
66+
path: .
67+
68+
- name: Setup git
69+
run: |
70+
git config user.email "[email protected]"
71+
git config user.name "Jazzer release pipeline"
72+
73+
- name: Extract API docs jar
74+
run: |
75+
git rm -rf jazzer-api
76+
mkdir jazzer-api
77+
unzip jazzer-api-docs.jar -d jazzer-api
78+
git add jazzer-api
79+
# Do not fail if no changes to commit
80+
# https://stackoverflow.com/questions/8123674/how-to-git-commit-nothing-without-an-error
81+
git diff-index --quiet HEAD || git commit -m "Automated update: jazzer-api docs"
82+
83+
- name: Extract Jazzer docs jar
84+
run: |
85+
git rm -rf jazzer
86+
mkdir jazzer
87+
unzip jazzer-docs.jar -d jazzer
88+
git add jazzer
89+
git diff-index --quiet HEAD || git commit -m "Automated update: jazzer docs"
90+
91+
- name: Extract JUnit docs jar
92+
run: |
93+
git rm -rf jazzer-junit
94+
mkdir jazzer-junit
95+
unzip jazzer-junit-docs.jar -d jazzer-junit
96+
git add jazzer-junit
97+
git diff-index --quiet HEAD || git commit -m "Automated update: jazzer-junit docs"
98+
99+
- name: Push changes
100+
run: |
101+
git push

0 commit comments

Comments
 (0)