-
Notifications
You must be signed in to change notification settings - Fork 21
57 lines (46 loc) · 1.67 KB
/
publish_java_client.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
57
name: Publish Java Client
on:
workflow_dispatch:
push:
branches: [ develop ]
paths-ignore: ['**.md']
pull_request:
branches: [ develop ]
paths-ignore: ['**.md']
merge_group:
branches: [ develop ]
paths-ignore: ['**.md']
concurrency:
# Don't run this workflow concurrently on the same branch
group: ${{ github.workflow }}-${{ github.ref }}
# For PRs, don't wait for completion of existing runs, cancel them instead
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
generateAndPublishClient:
runs-on: ubuntu-latest
env:
ARTIFACTORY_USERNAME: ${{secrets.ARTIFACTORY_USERNAME}}
ARTIFACTORY_PASSWORD: ${{secrets.ARTIFACTORY_PASSWORD}}
SBT_OPTS: -Xmx3g
steps:
- uses: actions/checkout@v3
# coursier cache action caches both coursier and sbt caches
- name: coursier-cache-action
uses: coursier/cache-action@v5
- name: Extract branch name
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
id: extractBranch
- name: Generate java client
id: generateJavaClient
run: bash codegen_java/gen_java_client.sh
- name: Publish java client for merge to develop branch
working-directory: codegen_java
id: publishJavaClient
if: ${{steps.extractBranch.outputs.branch == 'develop'}}
run: sbt "+ publish" -Dproject.isSnapshot=false
- name: Publish java client as snapshot for PRs
working-directory: codegen_java
id: publishJavaClientSnapshot
if: ${{steps.extractBranch.outputs.branch != 'develop'}}
run: sbt "+ publish" -Dproject.isSnapshot=true