Skip to content

Commit

Permalink
Update workflow to add github release functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
ChinthakaJ98 authored Dec 5, 2024
1 parent 12fd2d1 commit 8949a2a
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ jobs:

steps:
- name: Checkout
id: checkout
uses: actions/[email protected]
with:
token: ${{ secrets.WSO2_INTEGRATION_BOT_TOKEN }}
Expand All @@ -20,6 +19,11 @@ jobs:
with:
distribution: 'adopt'
java-version: 11
- name: Extract project version
run: |
VERSION=$(grep -oPm1 "(?<=<version>)[^<]+" pom.xml | sed 's/-SNAPSHOT$//')
VERSION_TAG="v$VERSION"
echo "VERSION_TAG=$VERSION_TAG" >> $GITHUB_ENV
- name: Configure Maven settings file
run: |
mkdir -p ~/.m2
Expand All @@ -36,8 +40,21 @@ jobs:
run: |
git config --global user.name ${{ secrets.WSO2_INTEGRATION_BOT_USERNAME }}
git config --global user.email ${{ secrets.WSO2_INTEGRATION_BOT_EMAIL }}
- name: Build artifacts
run: |
mvn clean install
- name: Deploy artifacts with Maven
env:
GITHUB_TOKEN: ${{ secrets.WSO2_INTEGRATION_BOT_TOKEN }}
run: |
mvn --batch-mode release:prepare release:perform
mvn --batch-mode release:prepare release:perform -Dtag=${{ env.VERSION_TAG }}
- name: Create Github Release with Assets
env:
GITHUB_TOKEN: ${{ secrets.WSO2_INTEGRATION_BOT_TOKEN }}
run: |
find target/ -type f -name '*-SNAPSHOT.zip' -exec rm -f {} \;
gh release create "${{ env.VERSION_TAG }}" \
--repo="$GITHUB_REPOSITORY" \
--title="${{ env.VERSION_TAG }}" \
--generate-notes \
target/*.zip

0 comments on commit 8949a2a

Please sign in to comment.