CI #756
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
name: CI | |
on: | |
push: | |
pull_request: | |
workflow_dispatch: | |
inputs: | |
release: | |
description: 'Release? Major/Minor/Patch/None' | |
required : true | |
default: 'None' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
id-token: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Cache Gradle | |
uses: actions/cache@v2 | |
with: | |
path: ~/.gradle | |
key: ${{ runner.os }}-${{ hashFiles('gradle') }} | |
- name: Build | |
run: ./gradlew build | |
- name: Upload test reports | |
if: always() | |
uses: actions/upload-artifact@v2 | |
with: | |
name: test-reports | |
path: build/reports/tests | |
- name: Upload pitest reports | |
if: always() | |
uses: actions/upload-artifact@v2 | |
with: | |
name: pitest-reports | |
path: build/reports/pitest | |
- name: Get publish token | |
id: publish-token | |
if: github.event.inputs.release != null && github.event.inputs.release != 'None' | |
uses: atlassian-labs/[email protected] | |
- name: Release | |
if: github.event.inputs.release != null && github.event.inputs.release != 'None' | |
env: | |
atlassian_private_username: ${{ steps.publish-token.outputs.artifactoryUsername }} | |
atlassian_private_password: ${{ steps.publish-token.outputs.artifactoryApiKey }} | |
run: | | |
./gradlew markNextVersion -Prelease.incrementer=increment${{ github.event.inputs.release }} -Prelease.localOnly | |
./gradlew release -Prelease.customUsername=${{ secrets.REPOSITORY_ACCESS_TOKEN }} | |
./gradlew publish |