Publish Release #4
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
name: Publish Release | |
on: | |
workflow_dispatch | |
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 11 | |
uses: actions/setup-java@v3 | |
with: | |
distribution: 'temurin' | |
java-version: 11 | |
- 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 | |
- 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} | |
- 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 "GraphQL-Federation-Gateway-v$VERSION" | |
gh pr create --title "[Automated] Sync master after $VERSION release" --body "Sync master after $VERSION release" |