-
Notifications
You must be signed in to change notification settings - Fork 2
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 #2 from DharshiBalasubramaniyam/client
Add client code
- Loading branch information
Showing
55 changed files
with
3,927 additions
and
250 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 |
---|---|---|
|
@@ -10,3 +10,5 @@ | |
# Binary files should be left untouched | ||
*.jar binary | ||
|
||
# Ensure all Java files use LF. | ||
*.java eol=lf |
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,56 @@ | ||
name: Build | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths-ignore: | ||
- '*.md' | ||
- 'docs/**' | ||
- 'load-tests/**' | ||
|
||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
if: github.repository_owner == 'xlibb' | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v2 | ||
with: | ||
distribution: 'temurin' | ||
java-version: 17.0.7 | ||
|
||
- name: Change to Timestamped Version | ||
run: | | ||
startTime=$(TZ="Asia/Kolkata" date +'%Y%m%d-%H%M00') | ||
latestCommit=$(git log -n 1 --pretty=format:"%h") | ||
VERSION=$((grep -w 'version' | cut -d= -f2) < gradle.properties | rev | cut --complement -d- -f1 | rev) | ||
updatedVersion=$VERSION-$startTime-$latestCommit | ||
echo $updatedVersion | ||
sed -i "s/version=\(.*\)/version=$updatedVersion/g" gradle.properties | ||
- name: Grant execute permission for gradlew | ||
run: chmod +x gradlew | ||
|
||
- name: Build with Gradle | ||
env: | ||
packageUser: ${{ secrets.BALLERINA_BOT_USERNAME }} | ||
packagePAT: ${{ secrets.BALLERINA_BOT_TOKEN }} | ||
publishUser: ${{ secrets.BALLERINA_BOT_USERNAME }} | ||
publishPAT: ${{ secrets.BALLERINA_BOT_TOKEN }} | ||
run: ./gradlew publish --no-daemon --scan | ||
|
||
- name: Generate Codecov Report | ||
uses: codecov/codecov-action@v3 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
- name: Upload Artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ballerina-runtime | ||
path: target/ballerina-runtime/ |
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,81 @@ | ||
name: Publish to the Ballerina central | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
environment: | ||
type: choice | ||
description: Select Environment | ||
required: true | ||
options: | ||
- DEV CENTRAL | ||
- STAGE CENTRAL | ||
|
||
jobs: | ||
publish-release: | ||
runs-on: ubuntu-latest | ||
if: github.repository_owner == 'xlibb' | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v2 | ||
with: | ||
distribution: 'temurin' | ||
java-version: 17.0.7 | ||
|
||
- name: Grant execute permission for gradlew | ||
run: chmod +x gradlew | ||
|
||
- name: Build with Gradle | ||
env: | ||
packageUser: ${{ github.actor }} | ||
packagePAT: ${{ secrets.GITHUB_TOKEN }} | ||
run: ./gradlew build -x check -x test | ||
|
||
- name: Create lib directory if not exists | ||
run: mkdir -p ballerina/lib | ||
|
||
- name: Run Trivy vulnerability scanner | ||
uses: aquasecurity/[email protected] | ||
with: | ||
scan-type: "rootfs" | ||
scan-ref: '/github/workspace/ballerina/lib' | ||
format: "table" | ||
timeout: "10m0s" | ||
exit-code: "1" | ||
scanners: "vuln" | ||
|
||
- name: Publish artifact | ||
env: | ||
BALLERINA_CENTRAL_ACCESS_TOKEN: ${{ secrets.BALLERINA_CENTRAL_ACCESS_TOKEN }} | ||
packageUser: ${{ secrets.BALLERINA_BOT_USERNAME }} | ||
packagePAT: ${{ secrets.BALLERINA_BOT_TOKEN }} | ||
GITHUB_TOKEN: ${{ secrets.BALLERINA_BOT_TOKEN }} | ||
run: ./gradlew clean build -PpublishToCentral=true | ||
|
||
- name: Ballerina Central Dev Push | ||
if: ${{ inputs.environment == 'DEV CENTRAL' }} | ||
env: | ||
BALLERINA_DEV_CENTRAL: true | ||
BALLERINA_STAGE_CENTRAL: false | ||
BALLERINA_CENTRAL_ACCESS_TOKEN: ${{ secrets.BALLERINA_CENTRAL_DEV_ACCESS_TOKEN }} | ||
packageUser: ${{ secrets.BALLERINA_BOT_USERNAME }} | ||
packagePAT: ${{ secrets.BALLERINA_BOT_TOKEN }} | ||
GITHUB_TOKEN: ${{ secrets.BALLERINA_BOT_TOKEN }} | ||
run: | | ||
sed -i 's/version=\(.*\)-SNAPSHOT/version=\1/g' gradle.properties | ||
./gradlew clean build -PpublishToCentral=true ${{ inputs.additional-publish-flags }} | ||
- name: Ballerina Central Stage Push | ||
if: ${{ inputs.environment == 'STAGE CENTRAL' }} | ||
env: | ||
BALLERINA_DEV_CENTRAL: false | ||
BALLERINA_STAGE_CENTRAL: true | ||
BALLERINA_CENTRAL_ACCESS_TOKEN: ${{ secrets.BALLERINA_CENTRAL_STAGE_ACCESS_TOKEN }} | ||
packageUser: ${{ secrets.BALLERINA_BOT_USERNAME }} | ||
packagePAT: ${{ secrets.BALLERINA_BOT_TOKEN }} | ||
GITHUB_TOKEN: ${{ secrets.BALLERINA_BOT_TOKEN }} | ||
run: | | ||
sed -i 's/version=\(.*\)-SNAPSHOT/version=\1/g' gradle.properties | ||
./gradlew clean build -PpublishToCentral=true ${{ inputs.additional-publish-flags }} |
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,86 @@ | ||
name: Publish Release | ||
|
||
on: | ||
workflow_dispatch: | ||
repository_dispatch: | ||
types: [ stdlib-release-pipeline ] | ||
|
||
jobs: | ||
publish-release: | ||
name: Release Package | ||
runs-on: ubuntu-latest | ||
if: github.repository_owner == 'xlibb' | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v2 | ||
with: | ||
distribution: 'temurin' | ||
java-version: 17.0.7 | ||
|
||
- name: Grant execute permission for gradlew | ||
run: chmod +x gradlew | ||
|
||
- name: Grant execute permission for gradlew | ||
run: chmod +x gradlew | ||
|
||
- name: Build with Gradle | ||
env: | ||
packageUser: ${{ github.actor }} | ||
packagePAT: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
git config --global user.name ${{ secrets.BALLERINA_BOT_USERNAME }} | ||
git config --global user.email ${{ secrets.BALLERINA_BOT_EMAIL }} | ||
./gradlew build -x check -x test -x :selenium-examples:build | ||
- name: Create lib directory if not exists | ||
run: mkdir -p ballerina/lib | ||
|
||
- name: Run Trivy vulnerability scanner | ||
uses: aquasecurity/[email protected] | ||
with: | ||
scan-type: "rootfs" | ||
scan-ref: '/github/workspace/ballerina/lib' | ||
format: "table" | ||
timeout: "10m0s" | ||
exit-code: "1" | ||
scanners: "vuln" | ||
|
||
- name: Get Release Version | ||
run: echo "VERSION=$((grep -w 'version' | cut -d= -f2) < gradle.properties | rev | cut --complement -d- -f1 | rev)" >> $GITHUB_ENV | ||
|
||
- name: Pre release dependency version update | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.BALLERINA_BOT_TOKEN }} | ||
run: | | ||
echo "Version: ${VERSION}" | ||
git checkout -b release-${VERSION} | ||
sed -i 's/ballerinaLangVersion=\(.*\)-SNAPSHOT/ballerinaLangVersion=\1/g' gradle.properties | ||
sed -i 's/ballerinaLangVersion=\(.*\)-[0-9]\{8\}-[0-9]\{6\}-.*$/ballerinaLangVersion=\1/g' gradle.properties | ||
sed -i 's/stdlib\(.*\)=\(.*\)-SNAPSHOT/stdlib\1=\2/g' gradle.properties | ||
sed -i 's/stdlib\(.*\)=\(.*\)-[0-9]\{8\}-[0-9]\{6\}-.*$/stdlib\1=\2/g' gradle.properties | ||
sed -i 's/observe\(.*\)=\(.*\)-SNAPSHOT/observe\1=\2/g' gradle.properties | ||
sed -i 's/observe\(.*\)=\(.*\)-[0-9]\{8\}-[0-9]\{6\}-.*$/observe\1=\2/g' gradle.properties | ||
git add gradle.properties | ||
git commit -m "Move dependencies to stable version" || echo "No changes to commit" | ||
- name: Publish Package | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.BALLERINA_BOT_TOKEN }} | ||
BALLERINA_CENTRAL_ACCESS_TOKEN: ${{ secrets.BALLERINA_CENTRAL_ACCESS_TOKEN }} | ||
packageUser: ${{ secrets.BALLERINA_BOT_USERNAME }} | ||
packagePAT: ${{ secrets.BALLERINA_BOT_TOKEN }} | ||
publishUser: ${{ secrets.BALLERINA_BOT_USERNAME }} | ||
publishPAT: ${{ secrets.BALLERINA_BOT_TOKEN }} | ||
run: | | ||
./gradlew clean release -Prelease.useAutomaticVersion=true | ||
./gradlew -Pversion=${VERSION} publish -x test -PpublishToCentral=true | ||
- name: GitHub Release and Release Sync PR | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.BALLERINA_BOT_TOKEN }} | ||
run: | | ||
gh release create v$VERSION --title "module-selenium-v$VERSION" | ||
gh pr create --title "[Automated] Sync main after $VERSION release" --body "Sync main after $VERSION release" |
Oops, something went wrong.