-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add workflow to regenerate connectors
- Loading branch information
1 parent
4501d1e
commit bbaa413
Showing
3 changed files
with
193 additions
and
1 deletion.
There are no files selected for viewing
Empty file.
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,76 @@ | ||
name: Regenerate Connectors | ||
|
||
on: | ||
# # Run nightly at 2:00 AM | ||
# schedule: | ||
# - cron: '0 2 * * *' | ||
# Trigger manually with specified Ballerina Docker version | ||
workflow_dispatch: | ||
inputs: | ||
bal_docker_version: | ||
description: Ballerina Docker version | ||
required: true | ||
default: 'nightly' | ||
client_method: | ||
description: Expected Client Method Type | ||
required: true | ||
default: 'remote' | ||
options: ['remote', 'resource'] | ||
artifact_id: | ||
description: Artifact Id | ||
required: false | ||
default: '' | ||
|
||
|
||
jobs: | ||
# regenerate_connectors_with_nightly: | ||
# if: github.event_name == 'schedule' | ||
# runs-on: ubuntu-latest | ||
# container: | ||
# image: ballerina/ballerina:nightly | ||
# options: --user root | ||
# steps: | ||
# - name: Checkout code | ||
# uses: actions/checkout@v2 | ||
|
||
# - name: Build with Gradle | ||
# env: | ||
# JAVA_OPTS: -DBALLERINA_DEV_COMPILE_BALLERINA_ORG=true | ||
# GRADLE_USER_HOME: ~/.gradle | ||
# run: | | ||
# ./gradlew build -PtestConnectorGeneration=true -PclientMethod=${{ github.event.inputs.client_method }} | ||
|
||
regenerate_connectors_with_specified_version: | ||
if: github.event_name == 'workflow_dispatch' | ||
runs-on: ubuntu-latest | ||
container: | ||
image: ballerina/ballerina:${{ github.event.inputs.bal_docker_version }} | ||
options: --user root | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- name: Build with Gradle | ||
env: | ||
JAVA_OPTS: -DBALLERINA_DEV_COMPILE_BALLERINA_ORG=true | ||
GRADLE_USER_HOME: ~/.gradle | ||
run: | | ||
if [[ github.event.inputs.artifact_id != '' ]]; then | ||
wget --header="Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" -O ballerina.zip "https://api.github.com/repos/ballerina-platform/ballerina-distribution/actions/artifacts/${{ github.event.inputs.artifact_id }}/zip" | ||
unzip -o ballerina.zip | ||
balDistZip=$(find . -name 'ballerina-*.zip' | head -n 1) | ||
echo "Unzipping ${balDistZip}" | ||
unzip -o "${balDistZip}" | ||
EXTRACTED_DISTRIBUTION_PATH="${balDistZip%.zip}" | ||
ABSOLUTE_EXTRACTED_DISTRIBUTION_PATH=$(realpath "$EXTRACTED_DISTRIBUTION_PATH") | ||
echo "Start generation flow..." | ||
./gradlew build -PtestConnectorGeneration=true -PclientMethod=${{ github.event.inputs.client_method }} -PcustomDistributionPath=$ABSOLUTE_EXTRACTED_DISTRIBUTION_PATH | ||
else | ||
echo "Start generation flow..." | ||
./gradlew build -PtestConnectorGeneration=true -PclientMethod=${{ github.event.inputs.client_method }} | ||
fi | ||
- name: Upload Summary Report | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: summary-report | ||
path: .github/reports/summary.txt |
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