Skip to content

Commit

Permalink
ops: workflow release sdk (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
manuraf authored Oct 30, 2023
1 parent 17bc497 commit 41d32fb
Show file tree
Hide file tree
Showing 6 changed files with 81 additions and 6 deletions.
65 changes: 65 additions & 0 deletions .github/workflows/release_onboarding_sdk.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Release onboarding sdk

on:
pull_request:
branches:
- develop
types: [ closed ]
paths:
- 'onboarding-sdk/**/src/**'

workflow_dispatch:

permissions:
packages: write
contents: write

jobs:
setup:
name: Release
runs-on: ubuntu-latest
if: github.event.pull_request.merged == true
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.ref_name }}

- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
cache: maven

- name: Set patch
run: |
mvn build-helper:parse-version versions:set -pl onboarding-sdk -DnewVersion='${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.nextIncrementalVersion}'
mvn versions:commit -f onboarding-sdk/pom.xml
shell: bash

- name: Get Version
run: |
echo "VERSION=$(mvn -pl onboarding-sdk help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_ENV
echo "🆙 Bump Version to ${VERSION}"
shell: bash

- name: Push New Version
shell: bash
run: |
echo "${VERSION}"
git ls-files ./onboarding-sdk | grep 'pom.xml' | xargs git add
git config --global user.email "[email protected]"
git config --global user.name "selfcare-github-bot"
git commit -m "Bump onboarding SDK to version ${VERSION}" || exit 0
git push origin ${{ github.ref_name}}
- name: Build with Maven
run: mvn -B package -f onboarding-sdk/pom.xml
shell: bash

- name: Deploy to GitHub Package Registry
run: |
mvn -B deploy -f onboarding-sdk/pom.xml
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7 changes: 4 additions & 3 deletions onboarding-functions/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
<quarkus.platform.version>3.3.3</quarkus.platform.version>
<skipITs>true</skipITs>
<surefire-plugin.version>3.1.2</surefire-plugin.version>
<onboarding-sdk.version>0.0.4</onboarding-sdk.version>
</properties>
<dependencyManagement>
<dependencies>
Expand Down Expand Up @@ -64,17 +65,17 @@
<dependency>
<groupId>it.pagopa.selfcare</groupId>
<artifactId>onboarding-sdk-azure-storage</artifactId>
<version>0.0.1</version>
<version>${onboarding-sdk.version}</version>
</dependency>
<dependency>
<groupId>it.pagopa.selfcare</groupId>
<artifactId>onboarding-sdk-product</artifactId>
<version>0.0.1</version>
<version>${onboarding-sdk.version}</version>
</dependency>
<dependency>
<groupId>it.pagopa.selfcare</groupId>
<artifactId>onboarding-sdk-common</artifactId>
<version>0.0.1</version>
<version>${onboarding-sdk.version}</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
Expand Down
2 changes: 1 addition & 1 deletion onboarding-sdk/onboarding-sdk-azure-storage/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>it.pagopa.selfcare</groupId>
<artifactId>onboarding-sdk</artifactId>
<version>0.0.1</version>
<version>0.0.4</version>
</parent>

<artifactId>onboarding-sdk-azure-storage</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion onboarding-sdk/onboarding-sdk-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>it.pagopa.selfcare</groupId>
<artifactId>onboarding-sdk</artifactId>
<version>0.0.1</version>
<version>0.0.4</version>
</parent>
<artifactId>onboarding-sdk-common</artifactId>
<name>onboarding-sdk-common</name>
Expand Down
2 changes: 1 addition & 1 deletion onboarding-sdk/onboarding-sdk-product/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>it.pagopa.selfcare</groupId>
<artifactId>onboarding-sdk</artifactId>
<version>0.0.1</version>
<version>0.0.4</version>
</parent>
<artifactId>onboarding-sdk-product</artifactId>
<name>onboarding-sdk-product</name>
Expand Down
9 changes: 9 additions & 0 deletions onboarding-sdk/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<artifactId>onboarding-sdk</artifactId>
<packaging>pom</packaging>
<name>onboarding-sdk</name>
<version>0.0.4</version>

<properties>
<maven.compiler.source>11</maven.compiler.source>
Expand All @@ -20,4 +21,12 @@
<module>onboarding-sdk-azure-storage</module>
<module>onboarding-sdk-common</module>
</modules>

<distributionManagement>
<repository>
<id>github</id>
<name>Selfcare Onboarding SDK</name>
<url>https://maven.pkg.github.com/pagopa/selfcare-onboarding</url>
</repository>
</distributionManagement>
</project>

0 comments on commit 41d32fb

Please sign in to comment.