-
Notifications
You must be signed in to change notification settings - Fork 51
60 lines (56 loc) · 1.98 KB
/
publish-release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
name: Publish Release
on:
workflow_dispatch:
jobs:
Ubuntu:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/[email protected]
with:
token: ${{ secrets.WSO2_INTEGRATION_BOT_TOKEN }}
fetch-depth: 0
- name: Set up JDK 11
uses: joschi/setup-jdk@v2
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
echo "<settings>
<servers>
<server>
<id>releases</id>
<username>${{ secrets.NEXUS_USERNAME }}</username>
<password>${{ secrets.NEXUS_PASSWORD }}</password>
</server>
</servers>
</settings>" > ~/.m2/settings.xml
- name: Configure git credentials
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 -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