-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from DimuthuMadushan/update-workflow
Add GitHub Release Publish
- Loading branch information
Showing
5 changed files
with
96 additions
and
42 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
name: Publish to the Ballerina DEV/STAGE Central | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
environment: | ||
type: choice | ||
description: Select environment | ||
required: true | ||
options: | ||
- 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 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_STAGE_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_DEV_ACCESS_TOKEN }} |
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
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
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
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