@@ -18,74 +18,74 @@ jobs:
1818
1919 # Steps represent a sequence of tasks that will be executed as part of the job
2020 steps :
21- # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
22- - name : Checkout Source
23- uses : actions/checkout@v2
24- - name : Checkout Submodules
25- uses : textbook/git-checkout-submodule-action@master
26- - name : Verify Gradle Wrapper
27- uses : gradle/wrapper-validation-action@v1
28- - name : Set up JDK 14
29- uses : actions/setup-java@v1
30- with :
31- java-version : 14
32- - name : Execute Gradle Build
33- uses : eskatos/gradle-command-action@v1
34- with :
35- # Gradle command line arguments, see gradle --help
36- arguments : buildDocs
21+ # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
22+ - name : Checkout Source
23+ uses : actions/checkout@v2
24+ with :
25+ submodules : recursive
26+ - name : Verify Gradle Wrapper
27+ uses : gradle/wrapper-validation-action@v1
28+ - name : Set up JDK 14
29+ uses : actions/setup-java@v1
30+ with :
31+ java-version : 14
32+ - name : Execute Gradle Build
33+ uses : eskatos/gradle-command-action@v1
34+ with :
35+ # Gradle command line arguments, see gradle --help
36+ arguments : buildDocs
3737
38- # do the following two things only for a release!
39- - name : Set Environment Variables for Release Version
40- if : startsWith(github.ref, 'refs/tags/')
41- run : echo "RELEASE_VERSION=${GITHUB_REF:10}" >> $GITHUB_ENV
42- - name : Create New Release Candidate
43- if : startsWith(github.ref, 'refs/tags/')
44- id : create-release-candidate
45- uses : actions/create-release@latest
46- env :
47- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
48- with :
49- tag_name : ${{ env.RELEASE_VERSION }}
50- release_name : Release Candidate ${{ env.RELEASE_VERSION }}
51- draft : false
52- prerelease : true
53- - name : Prepare Deployment
54- if : startsWith(github.ref, 'refs/tags/')
55- run : |
56- rm -rf ./build/tmp
57- cp ./docs-ext/curriculum-*.pdf ./build 2>/dev/null || :
58- zip -r release.zip ./build
59- mkdir release_dir
60- cp ./build/curriculum-*.pdf ./release_dir 2>/dev/null || :
61- mv release.zip ./release_dir/release-${{ env.RELEASE_VERSION }}.zip
62- - name : Deploy Release Candidate to GitHub Pages
63- if : startsWith(github.ref, 'refs/tags/')
64- uses : peaceiris/actions-gh-pages@v3
65- with :
66- github_token : ${{ secrets.GITHUB_TOKEN }}
67- publish_dir : ./build
68- destination_dir : release-candidate
69- keep_files : true
70- user_name : ' github-actions[bot]'
71- user_email : ' github-actions[bot]@users.noreply.github.com'
72- commit_message : Publish Release Candidate ${{ env.RELEASE_VERSION }}
73- - name : Upload Release Candidate Files
74- if : startsWith(github.ref, 'refs/tags/')
75- id : upload-release-candidate-assets
76- uses : actions/github-script@v2
77- env :
78- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
79- with :
80- script : |
81- const fs = require('fs').promises;
82- const { repo: { owner, repo }, sha } = context;
38+ # do the following two things only for a release!
39+ - name : Set Environment Variables for Release Version
40+ if : startsWith(github.ref, 'refs/tags/')
41+ run : echo "RELEASE_VERSION=${GITHUB_REF:10}" >> $GITHUB_ENV
42+ - name : Create New Release Candidate
43+ if : startsWith(github.ref, 'refs/tags/')
44+ id : create-release-candidate
45+ uses : actions/create-release@latest
46+ env :
47+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
48+ with :
49+ tag_name : ${{ env.RELEASE_VERSION }}
50+ release_name : Release Candidate ${{ env.RELEASE_VERSION }}
51+ draft : false
52+ prerelease : true
53+ - name : Prepare Deployment
54+ if : startsWith(github.ref, 'refs/tags/')
55+ run : |
56+ rm -rf ./build/tmp
57+ cp ./docs-ext/curriculum-*.pdf ./build 2>/dev/null || :
58+ zip -r release.zip ./build
59+ mkdir release_dir
60+ cp ./build/curriculum-*.pdf ./release_dir 2>/dev/null || :
61+ mv release.zip ./release_dir/release-${{ env.RELEASE_VERSION }}.zip
62+ - name : Deploy Release Candidate to GitHub Pages
63+ if : startsWith(github.ref, 'refs/tags/')
64+ uses : peaceiris/actions-gh-pages@v3
65+ with :
66+ github_token : ${{ secrets.GITHUB_TOKEN }}
67+ publish_dir : ./build
68+ destination_dir : release-candidate
69+ keep_files : true
70+ user_name : ' github-actions[bot]'
71+ user_email : ' github-actions[bot]@users.noreply.github.com'
72+ commit_message : Publish Release Candidate ${{ env.RELEASE_VERSION }}
73+ - name : Upload Release Candidate Files
74+ if : startsWith(github.ref, 'refs/tags/')
75+ id : upload-release-candidate-assets
76+ uses : actions/github-script@v2
77+ env :
78+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
79+ with :
80+ script : |
81+ const fs = require('fs').promises;
82+ const { repo: { owner, repo }, sha } = context;
8383
84- for (let file of await fs.readdir('./release_dir')) {
85- await github.repos.uploadReleaseAsset({
86- owner, repo,
87- release_id: ${{ steps.create-release-candidate.outputs.id }},
88- name: file,
89- data: await fs.readFile(`./release_dir/${file}`)
90- });
91- }
84+ for (let file of await fs.readdir('./release_dir')) {
85+ await github.repos.uploadReleaseAsset({
86+ owner, repo,
87+ release_id: ${{ steps.create-release-candidate.outputs.id }},
88+ name: file,
89+ data: await fs.readFile(`./release_dir/${file}`)
90+ });
91+ }
0 commit comments