JPERF-273: Jira provisioning hooks #411
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: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
workflow_dispatch: | |
inputs: | |
release: | |
description: 'Release? yes/no' | |
default: 'no' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check Docker | |
run: docker info | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Build | |
uses: gradle/gradle-build-action@v2 | |
with: | |
gradle-version: wrapper | |
arguments: build | |
- name: Upload test reports | |
if: always() | |
uses: actions/upload-artifact@v2 | |
with: | |
name: test-reports | |
path: build/reports/tests | |
- name: Upload test artifacts | |
if: always() | |
uses: actions/upload-artifact@v2 | |
with: | |
name: test-artifacts | |
path: build/test-artifacts | |
release: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
id-token: write | |
needs: build | |
if: github.event.inputs.release == 'yes' | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
- name: Get publish token | |
id: publish-token | |
uses: atlassian-labs/[email protected] | |
- name: Release | |
env: | |
atlassian_private_username: ${{ steps.publish-token.outputs.artifactoryUsername }} | |
atlassian_private_password: ${{ steps.publish-token.outputs.artifactoryApiKey }} | |
run: | | |
./gradlew release \ | |
-Prelease.customUsername=${{ github.actor }} \ | |
-Prelease.customPassword=${{ github.token }} | |
./gradlew publish |