Skip to content

Commit

Permalink
Merge pull request #49 from niveathika/main
Browse files Browse the repository at this point in the history
Improve dev/stage push workflow
  • Loading branch information
niveathika authored May 29, 2024
2 parents 87eadc6 + e21a385 commit 950fec8
Showing 1 changed file with 6 additions and 20 deletions.
26 changes: 6 additions & 20 deletions .github/workflows/dev-stage-central-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,24 +30,6 @@ jobs:
distribution: 'temurin'
java-version: 17.0.7

- name: Set ENV Variables
run: echo "VERSION=$((grep -w "version" | cut -d= -f2) < gradle.properties | rev | cut --complement -d- -f1 | rev)" >> $GITHUB_ENV

- name: Pre release depenency version update
env:
GITHUB_TOKEN: ${{ secrets.BALLERINA_BOT_TOKEN }}
run: |
echo "Version: ${VERSION}"
git config user.name ${{ secrets.BALLERINA_BOT_USERNAME }}
git config user.email ${{ secrets.BALLERINA_BOT_EMAIL }}
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
git add gradle.properties
git commit -m "Move dependencies to stable version" || echo "No changes to commit"
- name: Grant execute permission for gradlew
run: chmod +x gradlew

Expand All @@ -61,7 +43,9 @@ jobs:
packagePAT: ${{ secrets.BALLERINA_BOT_TOKEN }}
GITHUB_TOKEN: ${{ secrets.BALLERINA_BOT_TOKEN }}
run: |
./gradlew release
sed -i 's/version=\(.*\)-SNAPSHOT/version=\1/g' gradle.properties
./gradlew clean build
./gradlew :edi-tools-package:publishEDIPackage
- name: Ballerina Central Stage Push
if: ${{ inputs.environment == 'STAGE CENTRAL' }}
Expand All @@ -73,4 +57,6 @@ jobs:
packagePAT: ${{ secrets.BALLERINA_BOT_TOKEN }}
GITHUB_TOKEN: ${{ secrets.BALLERINA_BOT_TOKEN }}
run: |
./gradlew release
sed -i 's/version=\(.*\)-SNAPSHOT/version=\1/g' gradle.properties
./gradlew clean build
./gradlew :edi-tools-package:publishEDIPackage

0 comments on commit 950fec8

Please sign in to comment.