File tree Expand file tree Collapse file tree 4 files changed +39
-20
lines changed Expand file tree Collapse file tree 4 files changed +39
-20
lines changed Original file line number Diff line number Diff line change 11name : ' Check for new API spec version'
22
33on :
4- workflow_dispatch :
54 schedule :
65 - cron : ' 0 6 * * 1'
6+ workflow_dispatch :
7+ inputs :
8+ dry_run :
9+ description : ' Dry run'
10+ type : boolean
11+ required : false
12+ workflow_call :
713
814defaults :
915 run :
1016 shell : bash
1117
18+ env :
19+ DRY_RUN : ${{ github.event.inputs.dry_run || github.event_name == 'pull_request' }}
20+
1221jobs :
1322
1423 check-new-api-spec :
2433 [[ -n "$version" ]]
2534 echo "SPEC_VERSION=$version" | tee -a "$GITHUB_ENV"
2635 - name : ' Create PR'
36+ if : ${{ env.DRY_RUN == 'false' }}
2737 uses : peter-evans/create-pull-request@v4
2838 with :
2939 branch : " feature/api-spec-${{ env.SPEC_VERSION }}"
Original file line number Diff line number Diff line change 4444 - name : ' unittest discover'
4545 if : ${{ steps.diff.outputs.all_modified_files }}
4646 run : python3 -m unittest discover -bs .github/scripts
47+
48+ publish-javadoc-dry-run :
49+ uses : ./.github/workflows/publish-javadoc.yml
50+
51+ check-new-api-spec-dry-run :
52+ uses : ./.github/workflows/check-new-api-spec.yml
Original file line number Diff line number Diff line change 55 tags : ['*']
66 workflow_dispatch :
77 inputs :
8- version_name :
9- description : ' Version'
10- required : true
8+ dry_run :
9+ description : ' Dry run'
10+ type : boolean
11+ required : false
12+ workflow_call :
1113
1214defaults :
1315 run :
1416 shell : bash
1517
1618env :
17- VERSION_NAME : ${{ github.event.inputs.version_name || github.ref_name }}
19+ DRY_RUN : ${{ github.event.inputs.dry_run || github.event_name == 'pull_request' }}
20+ JAR_NAME : gradle-enterprise-api-kotlin-SNAPSHOT-javadoc.jar
1821
1922jobs :
2023
2124 build-javadoc :
2225 runs-on : ubuntu-latest
23- outputs :
24- version : ${{ env.VERSION }}
2526 steps :
2627 - name : Checkout
2728 uses : actions/checkout@v3
28- with :
29- ref : ${{ env.VERSION_NAME }}
3029 - name : Build javadoc
3130 uses : ./.github/actions/build
3231 with :
3332 tasks : ' javadocJar'
3433 artifact-name : ' javadoc'
35- path-to-upload : " build/libs/gradle-enterprise-api-kotlin- ${{ env.VERSION_NAME }}-javadoc.jar "
34+ path-to-upload : " build/libs/${{ env.JAR_NAME }}"
3635
37- commit-to-gh-pages :
36+ publish-javadoc :
3837 needs : [build-javadoc]
3938 runs-on : ubuntu-latest
4039 steps :
4140 - name : Checkout
4241 uses : actions/checkout@v3
43- with :
44- ref : ${{ env.VERSION_NAME }}
42+ - name : Fetch branch
43+ run : git fetch origin gh-pages && git checkout FETCH_HEAD
4544 - name : Download javadoc
4645 uses : actions/download-artifact@v3
47- - name : Commit and push
46+ - name : Unzip javadoc
47+ run : rm -rf docs && unzip "javadoc/$JAR_NAME" -d docs
48+ - name : Commit
4849 run : |
4950 git config user.name github-actions
5051 git config user.email [email protected] 51- git checkout gh-pages
52- rm -rf docs
53- unzip "gradle-enterprise-api-kotlin-$VERSION_NAME-javadoc.jar" -d docs
5452 git add docs
55- git commit -m "Add $VERSION_NAME javadoc"
56- git push
53+ git commit -m "Add ${{ github.ref_name }} javadoc"
54+ - name : Push
55+ run : |
56+ if [[ "$DRY_RUN" == 'true' ]]; then
57+ args=' --dry-run'
58+ fi
59+ git push origin HEAD:gh-pages $args
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ plugins {
1111}
1212
1313group = " com.github.gabrielfeo"
14- version = " 0.10.0 "
14+ version = " SNAPSHOT "
1515val repoUrl = " https://github.com/gabrielfeo/gradle-enterprise-api-kotlin"
1616
1717val downloadApiSpec by tasks.registering {
You can’t perform that action at this time.
0 commit comments