File tree Expand file tree Collapse file tree 1 file changed +37
-0
lines changed
Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Publish release
2+
3+ on :
4+ release :
5+ types : [published]
6+
7+ jobs :
8+ publish-release :
9+ runs-on : ubuntu-latest
10+
11+ steps :
12+ - name : Checkout latest code
13+ uses : actions/checkout@v2
14+
15+ - name : Set up JDK 11
16+ uses : actions/setup-java@v1
17+ with :
18+ java-version : 11
19+
20+ - name : Setup build cache
21+ uses : actions/cache@v1
22+ with :
23+ path : ~/.gradle/caches
24+ key : ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle.kts') }}
25+ restore-keys : |
26+ ${{ runner.os }}-gradle-
27+ - name : Publish artifact
28+ env :
29+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
30+
31+ # The GITHUB_REF tag comes in the format 'refs/tags/xxx'.
32+ # So if we split on '/' and take the 3rd value, we can get the release name.
33+ run : |
34+ NEW_VERSION=$(echo "${GITHUB_REF}" | cut -d "/" -f3)
35+ echo "New version: ${NEW_VERSION}"
36+ echo "Github username: ${GITHUB_ACTOR}"
37+ ./gradlew -Pversion=${NEW_VERSION} publish
You can’t perform that action at this time.
0 commit comments