From c6a543f7d55c52e2e8d46133dfa31bb9ac3f8840 Mon Sep 17 00:00:00 2001 From: Anuraag Agrawal Date: Tue, 6 Oct 2020 09:43:13 +0900 Subject: [PATCH] Add workflow for release build. (#221) Co-authored-by: srprash <50466688+srprash@users.noreply.github.com> --- .github/workflows/release-build.yml | 50 +++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 .github/workflows/release-build.yml diff --git a/.github/workflows/release-build.yml b/.github/workflows/release-build.yml new file mode 100644 index 00000000..1dab1016 --- /dev/null +++ b/.github/workflows/release-build.yml @@ -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