-
Notifications
You must be signed in to change notification settings - Fork 26
56 lines (54 loc) · 1.36 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
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: 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
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/artifact-publish-token@v1.0.1
- 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