Skip to content

Commit f3e6e79

Browse files
committed
set up publish to maven release.yml
1 parent 0aabcfd commit f3e6e79

File tree

4 files changed

+206
-207
lines changed

4 files changed

+206
-207
lines changed

.github/workflows/build.yml

Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,48 @@
1-
#name: Build
2-
#on: [push]
3-
#jobs:
4-
# build:
5-
# runs-on: ubuntu-20.04
6-
# steps:
7-
# - uses: actions/checkout@v2
8-
# - name: Set up JDK 11
9-
# uses: actions/setup-java@v2
10-
# with:
11-
# java-version: '11'
12-
# distribution: 'adopt'
13-
# - name: Cache Java modules
14-
# uses: actions/cache@v2
15-
# env:
16-
# cache-name: cache-java-modules
17-
# with:
18-
# path: ~/.m2
19-
# key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('./build.sbt') }}
20-
# restore-keys: |
21-
# ${{ runner.os }}-build-${{ env.cache-name }}-
22-
# ${{ runner.os }}-build-
23-
# ${{ runner.os }}-
24-
# - name: Cache Scala modules
25-
# uses: actions/cache@v2
26-
# env:
27-
# cache-name: cache-scala-modules
28-
# with:
29-
# path: ~/.m2
30-
# key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('./build.sbt') }}
31-
# restore-keys: |
32-
# ${{ runner.os }}-build-${{ env.cache-name }}-
33-
# ${{ runner.os }}-build-
34-
# ${{ runner.os }}-
35-
# - name: Cache Sbt modules
36-
# uses: actions/cache@v2
37-
# env:
38-
# cache-name: cache-sbt-modules
39-
# with:
40-
# path: ~/.sbt/1.0
41-
# key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('./build.sbt') }}
42-
# restore-keys: |
43-
# ${{ runner.os }}-build-${{ env.cache-name }}-
44-
# ${{ runner.os }}-build-
45-
# ${{ runner.os }}-
46-
# - name: Run Sbt Test and Generate Report on Multiple Scala Versions
47-
# run: |
48-
# sbt +package
1+
name: Build
2+
on: [push]
3+
jobs:
4+
build:
5+
runs-on: ubuntu-20.04
6+
steps:
7+
- uses: actions/checkout@v2
8+
- name: Set up JDK 11
9+
uses: actions/setup-java@v2
10+
with:
11+
java-version: '11'
12+
distribution: 'adopt'
13+
- name: Cache Java modules
14+
uses: actions/cache@v2
15+
env:
16+
cache-name: cache-java-modules
17+
with:
18+
path: ~/.m2
19+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('./build.sbt') }}
20+
restore-keys: |
21+
${{ runner.os }}-build-${{ env.cache-name }}-
22+
${{ runner.os }}-build-
23+
${{ runner.os }}-
24+
- name: Cache Scala modules
25+
uses: actions/cache@v2
26+
env:
27+
cache-name: cache-scala-modules
28+
with:
29+
path: ~/.m2
30+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('./build.sbt') }}
31+
restore-keys: |
32+
${{ runner.os }}-build-${{ env.cache-name }}-
33+
${{ runner.os }}-build-
34+
${{ runner.os }}-
35+
- name: Cache Sbt modules
36+
uses: actions/cache@v2
37+
env:
38+
cache-name: cache-sbt-modules
39+
with:
40+
path: ~/.sbt/1.0
41+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('./build.sbt') }}
42+
restore-keys: |
43+
${{ runner.os }}-build-${{ env.cache-name }}-
44+
${{ runner.os }}-build-
45+
${{ runner.os }}-
46+
- name: Run Sbt Test and Generate Report on Multiple Scala Versions
47+
run: |
48+
sbt +package

.github/workflows/linter.yml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
#name: Linter
2-
#on: [push]
3-
#jobs:
4-
# linter:
5-
# runs-on: ubuntu-20.04
6-
# steps:
7-
# - uses: actions/checkout@v2
8-
# - name: Set up JDK 11
9-
# uses: actions/setup-java@v2
10-
# with:
11-
# java-version: '11'
12-
# distribution: 'adopt'
13-
# - name: Run Scalastyle Linter
14-
# run: |
15-
# sbt +scalastyle
16-
# sbt +test:scalastyle
1+
name: Linter
2+
on: [push]
3+
jobs:
4+
linter:
5+
runs-on: ubuntu-20.04
6+
steps:
7+
- uses: actions/checkout@v2
8+
- name: Set up JDK 11
9+
uses: actions/setup-java@v2
10+
with:
11+
java-version: '11'
12+
distribution: 'adopt'
13+
- name: Run Scalastyle Linter
14+
run: |
15+
sbt +scalastyle
16+
sbt +test:scalastyle

.github/workflows/release.yml

Lines changed: 44 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,51 @@
1-
name: Publish documentation to project website and package to the Maven Central Repository
1+
name: Publish documentation to project website and Package to Maven Central Repository
22
on:
3-
[push]
4-
# release:
5-
# types: [created]
3+
release:
4+
types: [created]
65
jobs:
6+
publish-doc:
7+
runs-on: ubuntu-20.04
8+
steps:
9+
- name: Install ansi2txt tool
10+
run: |
11+
sudo apt-get update
12+
sudo apt-get install colorized-logs
13+
- uses: actions/checkout@v2
14+
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
38+
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
45+
746
publish-package:
847
runs-on: ubuntu-latest
9-
# needs: [publish-doc]
48+
needs: [publish-doc]
1049
steps:
1150
- name: Install gpg secret key
1251
run: |
@@ -25,43 +64,3 @@ jobs:
2564
env:
2665
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
2766
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
28-
29-
# publish-doc:
30-
# runs-on: ubuntu-20.04
31-
# steps:
32-
# - name: Install ansi2txt tool
33-
# run: |
34-
# sudo apt-get update
35-
# sudo apt-get install colorized-logs
36-
# - uses: actions/checkout@v2
37-
# with:
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

Comments
 (0)