-
Notifications
You must be signed in to change notification settings - Fork 5
86 lines (76 loc) · 2.74 KB
/
publish-release.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
name: Central Publish
on:
workflow_dispatch:
inputs:
environment:
type: choice
description: Select environment
required: true
options:
- CENTRAL
- DEV CENTRAL
- STAGE CENTRAL
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 17
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: |
sed -i 's/version=\(.*\)-SNAPSHOT/version=\1/g' gradle.properties
./gradlew clean build
env:
packageUser: ${{ secrets.BALLERINA_BOT_USERNAME }}
packagePAT: ${{ secrets.BALLERINA_BOT_TOKEN }}
- name: Build the final Copybook tools package using Ballerina
uses: ballerina-platform/ballerina-action/@2201.8.0
with:
args: pack ./copybook-tool
env:
JAVA_HOME: /usr/lib/jvm/default-jvm
- name: Ballerina Central Push
if: ${{ inputs.environment == 'CENTRAL' }}
uses: ballerina-platform/ballerina-action/@2201.8.0
with:
args: push
env:
WORKING_DIR: ./copybook-tool
BALLERINA_DEV_CENTRAL: false
BALLERINA_STAGE_CENTRAL: false
packageUser: ${{ secrets.BALLERINA_BOT_USERNAME }}
packagePAT: ${{ secrets.BALLERINA_BOT_TOKEN }}
JAVA_HOME: /usr/lib/jvm/default-jvm
BALLERINA_CENTRAL_ACCESS_TOKEN: ${{ secrets.BALLERINA_CENTRAL_ACCESS_TOKEN }}
- name: Ballerina Central Stage Push
if: ${{ inputs.environment == 'STAGE CENTRAL' }}
uses: ballerina-platform/ballerina-action/@2201.8.0
with:
args: push
env:
WORKING_DIR: ./copybook-tool
BALLERINA_DEV_CENTRAL: false
BALLERINA_STAGE_CENTRAL: true
packageUser: ${{ secrets.BALLERINA_BOT_USERNAME }}
packagePAT: ${{ secrets.BALLERINA_BOT_TOKEN }}
JAVA_HOME: /usr/lib/jvm/default-jvm
BALLERINA_CENTRAL_ACCESS_TOKEN: ${{ secrets.BALLERINA_CENTRAL_ACCESS_TOKEN }}
- name: Ballerina Central Dev Push
if: ${{ inputs.environment == 'DEV CENTRAL' }}
uses: ballerina-platform/ballerina-action/@2201.8.0
with:
args: push
env:
WORKING_DIR: ./copybook-tool
BALLERINA_DEV_CENTRAL: true
BALLERINA_STAGE_CENTRAL: false
packageUser: ${{ secrets.BALLERINA_BOT_USERNAME }}
packagePAT: ${{ secrets.BALLERINA_BOT_TOKEN }}
JAVA_HOME: /usr/lib/jvm/default-jvm
BALLERINA_CENTRAL_ACCESS_TOKEN: ${{ secrets.BALLERINA_CENTRAL_ACCESS_TOKEN }}