Skip to content

Commit

Permalink
added release github action
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Jul 29, 2021
1 parent 9cc464d commit b403f7a
Showing 1 changed file with 91 additions and 0 deletions.
91 changes: 91 additions & 0 deletions .github/workflows/release.yml
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

0 comments on commit b403f7a

Please sign in to comment.