Skip to content

Commit

Permalink
Add workflow for release build. (#221)
Browse files Browse the repository at this point in the history
Co-authored-by: srprash <[email protected]>
  • Loading branch information
Anuraag Agrawal and srprash authored Oct 6, 2020
1 parent b7ab810 commit c6a543f
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/release-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
on:
workflow_dispatch:
inputs:
version:
description: The version to tag the release with, e.g., 1.2.0, 1.2.1-alpha.1
required: true

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: 11
- name: Cache Gradle Modules
uses: actions/cache@v1
with:
path: ~/.gradle/caches
key: gradle-caches-${{ hashFiles('**/*.gradle.kts') }}
- name: Cache Gradle Wrapper
uses: actions/cache@v1
with:
path: ~/.gradle/wrapper
key: gradle-wrapper-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
- name: Build and test
run: ./gradlew build -Prelease.version=${{ github.event.inputs.version }} --stacktrace
env:
CI: true
- name: Publish to staging repo
run: ./gradlew final -Prelease.version=${{ github.event.inputs.version }} --stacktrace
env:
CI: true
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }}
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
GPG_PASSWORD: ${{ secrets.GPG_PASSWORD }}
GRGIT_USER: ${{ github.actor }}
GRGIT_PASS: ${{ secrets.GITHUB_TOKEN }}
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ github.event.inputs.version }}
release_name: Release v${{ github.event.inputs.version }}
draft: true
prerelease: false

0 comments on commit c6a543f

Please sign in to comment.