Skip to content

Commit

Permalink
Merge code and update build version
Browse files Browse the repository at this point in the history
  • Loading branch information
pankajjangid05 committed Jul 3, 2023
2 parents 9bfe7a1 + 085b09e commit 65a48e3
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 5 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/build-deploy-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Build & Deploy on Tag & Push
name: Github Package
on:
push:
tags:
["v*.*.*", "v*.*.*-*"]
branches:
["release-4.*.*", "release-5.*.*", "release-v2.*.*", "development"]
pull_request:
branches:
["release-4.*.*", "release-5.*.*", "release-v2.*.*", "development"]

jobs:
build-deploy-github:
name: Build & Deploy to GitHub
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v2
with:
java-version: 11
distribution: 'temurin'
server-id: github
server-username: GITHUB_USERNAME
server-password: GITHUB_TOKEN

- name: Cache Maven packages
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2-

- name: Extract version from pom.xml
id: version
run: |
echo ::set-output name=VERSION::$(grep -A 1 '<artifactId>message-rosa</artifactId>' pom.xml | grep -oP '(?<=<version>).*?(?=</version>)')
- name: Delete package specific version
uses: smartsquaregmbh/[email protected]
with:
version: ${{ steps.version.outputs.VERSION }}-SNAPSHOT
names: |
com.uci.message-rosa
token: ${{ secrets.TOKEN }}

- name: Deploy
run: mvn clean install -Pgithub deploy
env:
GITHUB_USERNAME: ${{ secrets.USERNAME }}
GITHUB_TOKEN: ${{ secrets.TOKEN }}
12 changes: 8 additions & 4 deletions .github/workflows/build-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ on:
tags:
["v*.*.*", "v*.*.*-*"]
branches:
["release-4.*.*", "release-5.*.*", "release-v2.*.*", "master", "development"]
["release-4.*.*", "release-5.*.*", "release-v2.*.*", "master"]
pull_request:
branches:
["release-4.*.*", "release-5.*.*", "release-v2.*.*", "master", "development"]
["release-4.*.*", "release-5.*.*", "release-v2.*.*", "master"]

jobs:
build-deploy-github:
Expand All @@ -32,11 +32,15 @@ jobs:
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2-

- name: Extract version from pom.xml
id: version
run: |
echo ::set-output name=VERSION::$(grep -A 1 '<artifactId>message-rosa</artifactId>' pom.xml | grep -oP '(?<=<version>).*?(?=</version>)')
- name: Delete package specific version
uses: smartsquaregmbh/[email protected]
with:
version: 2.2.4 # This should be same as in the pom.xml file,
# to delete only the pom specified version, not the other older versions
version: ${{ steps.version.outputs.VERSION }}
names: |
com.uci.message-rosa
token: ${{ secrets.TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</parent>
<groupId>com.uci</groupId>
<artifactId>message-rosa</artifactId>
<version>2.2.4</version>
<version>2.2.5</version>
<!-- On changing, Set version in deploy.xml to delete the previous packages if exists and deploy new package for the specified version -->
<name>message-rosa</name>
<description>message-rosa for messages</description>
Expand Down

0 comments on commit 65a48e3

Please sign in to comment.