11name : Publish documentation to project website and package to the Maven Central Repository
22on :
3- release :
4- types : [created]
3+ [push]
4+ # release:
5+ # types: [created]
56jobs :
6- publish-doc :
7- runs-on : ubuntu-20.04
7+ publish-package :
8+ runs-on : ubuntu-latest
9+ # needs: [publish-doc]
810 steps :
9- - name : Install ansi2txt tool
11+ - name : Install gpg secret key
1012 run : |
11- sudo apt-get update
12- sudo apt-get install colorized-logs
13+ cat <(echo -e "${{ secrets.SONATYPE_GPG_SECRET_KEY }}") | gpg --batch --import
14+ gpg --list-secret-keys --keyid-format LONG
1315 - uses : actions/checkout@v2
16+ - name : Set up Java
17+ uses : actions/setup-java@v2
1418 with :
15- token : ${{ secrets.PAT_TOKEN }}
16- - name : Generate API Doc
17- run : sbt +doc
18- - name : Make API Doc directory outside repository
19- run : mkdir -p ../api_docs
20- - name : Move API Docs to outside directory
21- run : |
22- source .workflow-scripts/put_scala_docs_aside.sh ./target ../api_docs
23- cp .workflow-scripts/move_scala_docs.sh ../api_docs/
24- cp .workflow-scripts/update_json_api_versions.py ../api_docs/
25- echo "scala_versions=$scala_versions" >> $GITHUB_ENV
26- echo "api_version=$api_version" >> $GITHUB_ENV
27- - name : Git checkout on gh-pages
28- run : |
29- git fetch
30- git checkout gh-pages
31- - name : Move API Docs to website API Docs directory
32- run : |
33- cd ..
34- export scala_versions="${{ env.scala_versions }}"
35- export api_version="${{ env.api_version }}"
36- bash api_docs/move_scala_docs.sh ./api_docs "./${GITHUB_REPOSITORY#*/}/docs/_api" ./api_docs "./${GITHUB_REPOSITORY#*/}/docs/_data/api_versions.json"
37- - name : Git add and commit on gh-pages
19+ java-version : ' 11'
20+ distribution : ' adopt'
21+ - name : Publish package
3822 run : |
39- git config user.name "$GITHUB_ACTOR"
40- git config user.email "$GITHUB_ACTOR+github-actions@users.noreply.github.com"
41- git add docs/_api/.
42- git add docs/_data/api_versions.json
43- git commit -m "[RELEASE] Update doc version from branch \"$GITHUB_REF\" commit \"$GITHUB_REF\""
44- git push
23+ sbt +publishSigned
24+ sbt +sonatypeBundleRelease
25+ env :
26+ SONATYPE_USERNAME : ${{ secrets.SONATYPE_USERNAME }}
27+ SONATYPE_PASSWORD : ${{ secrets.SONATYPE_PASSWORD }}
4528
46-
47- # publish-package:
48- # runs-on: ubuntu-latest
49- # needs: [publish-doc]
29+ # publish-doc:
30+ # runs-on: ubuntu-20.04
5031# steps:
32+ # - name: Install ansi2txt tool
33+ # run: |
34+ # sudo apt-get update
35+ # sudo apt-get install colorized-logs
5136# - uses: actions/checkout@v2
52- # - name: Set up Java
53- # uses: actions/setup-java@v2
5437# with:
55- # java-version: '11'
56- # distribution: 'adopt'
57- # - name: Publish package
58- # run: mvn --batch-mode deploy
59- # env:
60- # SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
61- # SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
38+ # token: ${{ secrets.PAT_TOKEN }}
39+ # - name: Generate API Doc
40+ # run: sbt +doc
41+ # - name: Make API Doc directory outside repository
42+ # run: mkdir -p ../api_docs
43+ # - name: Move API Docs to outside directory
44+ # run: |
45+ # source .workflow-scripts/put_scala_docs_aside.sh ./target ../api_docs
46+ # cp .workflow-scripts/move_scala_docs.sh ../api_docs/
47+ # cp .workflow-scripts/update_json_api_versions.py ../api_docs/
48+ # echo "scala_versions=$scala_versions" >> $GITHUB_ENV
49+ # echo "api_version=$api_version" >> $GITHUB_ENV
50+ # - name: Git checkout on gh-pages
51+ # run: |
52+ # git fetch
53+ # git checkout gh-pages
54+ # - name: Move API Docs to website API Docs directory
55+ # run: |
56+ # cd ..
57+ # export scala_versions="${{ env.scala_versions }}"
58+ # export api_version="${{ env.api_version }}"
59+ # bash api_docs/move_scala_docs.sh ./api_docs "./${GITHUB_REPOSITORY#*/}/docs/_api" ./api_docs "./${GITHUB_REPOSITORY#*/}/docs/_data/api_versions.json"
60+ # - name: Git add and commit on gh-pages
61+ # run: |
62+ # git config user.name "$GITHUB_ACTOR"
63+ # git config user.email "$GITHUB_ACTOR+github-actions@users.noreply.github.com"
64+ # git add docs/_api/.
65+ # git add docs/_data/api_versions.json
66+ # git commit -m "[RELEASE] Update doc version from branch \"$GITHUB_REF\" commit \"$GITHUB_REF\""
67+ # git push
0 commit comments