-
Notifications
You must be signed in to change notification settings - Fork 65
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 #4857 from MohamedSabthar/workflow-mig
- Loading branch information
Showing
2 changed files
with
69 additions
and
1 deletion.
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,68 @@ | ||
name: Publish Release (Connector) | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
package-name: | ||
required: true | ||
type: string | ||
package-org: | ||
required: true | ||
type: string | ||
additional-build-flags: | ||
required: false | ||
type: string | ||
default: "" | ||
additional-publish-flags: | ||
required: false | ||
type: string | ||
default: "" | ||
|
||
jobs: | ||
publish-release: | ||
name: Release Package | ||
runs-on: ubuntu-latest | ||
if: github.repository_owner == 'ballerina-platform' | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'temurin' | ||
java-version: 17.0.7 | ||
|
||
- name: Build without Tests | ||
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 ${{ inputs.additional-build-flags }} | ||
- name: Create lib Directory if not Exists | ||
run: mkdir -p ballerina/lib | ||
|
||
- name: Get Release Version | ||
run: echo "VERSION=$((grep -w 'version' | cut -d= -f2) < gradle.properties | rev | cut --complement -d- -f1 | rev)" >> $GITHUB_ENV | ||
|
||
- 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 ${{ inputs.additional-publish-flags }} | ||
- name: GitHub Release and Release Sync PR | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.BALLERINA_BOT_TOKEN }} | ||
run: | | ||
gh release create v$VERSION --title "module-${{ inputs.package-org }}-${{ inputs.package-name }}-v$VERSION" | ||
gh pr create --base ${GITHUB_REF##*/} --title "[Automated] Sync ${GITHUB_REF##*/} after $VERSION release" --body "Sync ${GITHUB_REF##*/} after $VERSION release" |
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