-
Notifications
You must be signed in to change notification settings - Fork 11
57 lines (46 loc) · 1.58 KB
/
snapshots.yaml
File metadata and controls
57 lines (46 loc) · 1.58 KB
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
57
name: Snapshots
on:
push:
branches:
- master
jobs:
publish-gcp-artifacts:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
with:
ref: ${{ github.ref }}
submodules: true
- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: 17
- name: Find Version
id: find_version
run: echo VERSION=$(./gradlew properties | grep ^version | awk '{print $2}') >> $GITHUB_OUTPUT
- name: Check if version is snapshot
id: find_is_snapshot
run: echo IS_SNAPSHOT=$(echo ${{ steps.find_version.outputs.VERSION }} | grep -qi SNAPSHOT && echo true || echo false) >> $GITHUB_OUTPUT
- name: Show version
run: echo ${{ steps.find_version.outputs.VERSION }}
- name: Show is snapshot
run: echo ${{ steps.find_is_snapshot.outputs.IS_SNAPSHOT }}
- name: Check
uses: eskatos/gradle-command-action@v1
with:
arguments: check
if: steps.find_is_snapshot.outputs.IS_SNAPSHOT == 'true'
- name: Setup GCP
uses: google-github-actions/setup-gcloud@v0
with:
project_id: ${{ secrets.GCP_PROJECT_ID }}
service_account_key: ${{ secrets.GCP_ARTIFACTS_KEY }}
export_default_credentials: true
if: steps.find_is_snapshot.outputs.IS_SNAPSHOT == 'true'
- name: Upload to GCP
uses: eskatos/gradle-command-action@v1
with:
arguments: publish
env:
ENABLE_GCP: true
if: steps.find_is_snapshot.outputs.IS_SNAPSHOT == 'true'