-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update workflow to add github release functionality
- Loading branch information
1 parent
12fd2d1
commit 8949a2a
Showing
1 changed file
with
19 additions
and
2 deletions.
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 |
---|---|---|
|
@@ -10,7 +10,6 @@ jobs: | |
|
||
steps: | ||
- name: Checkout | ||
id: checkout | ||
uses: actions/[email protected] | ||
with: | ||
token: ${{ secrets.WSO2_INTEGRATION_BOT_TOKEN }} | ||
|
@@ -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 | ||
|
@@ -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 |