Skip to content

Commit

Permalink
[ci] improve release job
Browse files Browse the repository at this point in the history
  • Loading branch information
cyrilou242 committed Jul 8, 2023
1 parent 5ae3188 commit 06711b3
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,13 @@ jobs:
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}

# don't use setup-java cache - hash file pattern has issues
- name: Cache local Maven repository
uses: actions/cache@v3
- name: Cache - restore local Maven repository
id: cache-restore
uses: actions/cache/restore@v3
with:
path: ~/.m2/repository
key: license-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml', 'LICENSE', 'HEADER') }}
key: release-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: release-${{ runner.os }}-maven-
- name: set github user
run: |
git config --global user.name "jnotebook-ci"
Expand All @@ -41,7 +43,8 @@ jobs:
- name: generate doc
id: generate_doc
run: |
java -jar jnotebook-distribution/target/jnotebook-distribution-*-SNAPSHOT.jar render doc/book.jsh index.html
./mvnw -q -U clean install -DskipTests
./jnotebook-distribution/target/jnotebook-distribution-*-SNAPSHOT.jar render -cp="" doc/book.jsh index.html
EOF="EOFLOL"
echo "INDEX_HTML<<$EOF" >> "$GITHUB_OUTPUT"
cat index.html >> $GITHUB_OUTPUT
Expand All @@ -57,4 +60,11 @@ jobs:
git push
env:
INDEX_HTML: ${{ steps.generate_doc.outputs.INDEX_HTML }}
- name: Cache - save local Maven repository
uses: actions/cache/save@v3
# save to cache only if necessary + cache even if tests failed (useful if flakiness)
if: steps.cache-restore.outputs.cache-hit != 'true' && ( failure() || success())
with:
path: ~/.m2/repository
key: release-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}

0 comments on commit 06711b3

Please sign in to comment.