-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9cc464d
commit b403f7a
Showing
1 changed file
with
91 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
name: Release | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
description: "Release version" | ||
required: true | ||
jobs: | ||
release: | ||
name: Release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up Java | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: 11 | ||
|
||
- uses: actions/cache@v2 | ||
with: | ||
path: ~/.gradle/caches | ||
key: ${{ runner.os }}-gradle-cache-${{ hashFiles('**/*.gradle') }}-${{ hashFiles('**/gradle.properties') }} | ||
restore-keys: | | ||
${{ runner.os }}-gradle- | ||
- uses: actions/cache@v2 | ||
with: | ||
path: ~/.gradle/wrapper | ||
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('**/gradlew') }} | ||
restore-keys: | | ||
${{ runner.os }}-gradlew- | ||
- name: Set release version | ||
run: | | ||
VERSION=${{ github.event.inputs.version }} | ||
sed -i -e "s/^version\=.*/version=$VERSION/g" gradle.properties | ||
sed -i -e "s/^\:project-version\:\ .*/:project-version: $VERSION/g" README.adoc | ||
git add gradle.properties | ||
git add README.adoc | ||
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" | ||
git config --global user.name "GitHub Action" | ||
git commit -a -m "Releasing version $VERSION" | ||
git push origin master | ||
- name: Build | ||
run: | | ||
./gradlew -Prelease=true build -S | ||
- name: Deploy | ||
env: | ||
GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }} | ||
GPG_SECRET_KEY: ${{ secrets.GPG_SECRET_KEY }} | ||
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | ||
run: | | ||
./gradlew -Prelease=true -Pfull-release=true build -S | ||
- name: Assemble | ||
uses: jreleaser/release-action@v1 | ||
with: | ||
arguments: assemble | ||
env: | ||
JRELEASER_PROJECT_VERSION: ${{ github.event.inputs.version }} | ||
JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Release | ||
uses: jreleaser/release-action@v1 | ||
with: | ||
arguments: full-release | ||
env: | ||
JRELEASER_PROJECT_VERSION: ${{ github.event.inputs.version }} | ||
JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
JRELEASER_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | ||
JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.GPG_PUBLIC_KEY }} | ||
JRELEASER_GPG_SECRET_KEY: ${{ secrets.GPG_SECRET_KEY }} | ||
JRELEASER_DOCKER_DEFAULT_PASSWORD: ${{ secrets.JRELEASER_DOCKER_PASSWORD }} | ||
|
||
- name: JReleaser output | ||
if: always() | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: artifact | ||
path: | | ||
out/jreleaser/trace.log | ||
out/jreleaser/output.properties | ||
- name: Guide | ||
run: ./gradlew createGuide gitPublishPush -S |