Skip to content

Commit

Permalink
Release with matrix build (#45)
Browse files Browse the repository at this point in the history
  • Loading branch information
kkorotkov authored Dec 12, 2023
1 parent fe887fc commit abc09fc
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 21 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/netlicensing-client-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ jobs:
name: Release ${{ github.event.inputs.release-version }}
runs-on: self-hosted
container: maven:3-amazoncorretto-17
strategy:
matrix:
java-version: [11, 17]
include:
- java-version: 11
jdk-suffix:
- java-version: 17
jdk-suffix: -jdk17

steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -45,12 +53,20 @@ jobs:
- name: Import GPG key
run: echo "${{ secrets.GPG_KEY }}" | base64 -d | gpg --pinentry-mode loopback --passphrase "${{ secrets.GPG_KEY_PASS }}" --import

- name: Calculate branch suffix
run: |
BRANCH_SUFFIX=${{ matrix.jdk-suffix }}
echo "Branch suffix: '$BRANCH_SUFFIX'"
echo "BRANCH_SUFFIX=$BRANCH_SUFFIX" >> "$GITHUB_ENV"
- name: Release to Maven Central staging
run: |
mvn -s ~/.m2/settings.xml -B \
clean deploy scm:tag \
-P release \
-Drevision=${{ github.event.inputs.release-version }} \
-Dsha1=$BRANCH_SUFFIX \
-Dchangelist= \
-Djava.version=${{ matrix.java-version }}
-Dmessage="Release ${{ github.event.inputs.release-version }}" \
-Dgpg.passphrase=${{ secrets.GPG_KEY_PASS }}
21 changes: 9 additions & 12 deletions .github/workflows/netlicesning-client-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,14 @@ jobs:
java-version: [11, 17]
include:
- java-version: 11
mvn-goal: deploy
jdk-suffix:
- java-version: 17
mvn-goal: verify
jdk-suffix: -jdk17


steps:
- uses: actions/checkout@v3

- name: Set up JDK ${{ matrix.java-version }}
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.java-version }}
distribution: 'adopt'
cache: maven

- name: Prepare maven settings.xml
run: |
mkdir -p ~/.m2
Expand All @@ -64,16 +57,20 @@ jobs:
if [ "$GITHUB_REF_NAME" = "master" ]
then
# No suffix when running against "master" branch
BRANCH_SUFFIX=
BRANCH_SUFFIX=${{ matrix.jdk-suffix }}
else
# When running from pull request, use "-pr-<N>" suffix, where <N> is a PR number
BRANCH_SUFFIX=-pr-${GITHUB_REF_NAME//\/merge/}
BRANCH_SUFFIX=${{ matrix.jdk-suffix }}-pr-${GITHUB_REF_NAME//\/merge/}
fi
echo "Branch suffix: '$BRANCH_SUFFIX'"
echo "BRANCH_SUFFIX=$BRANCH_SUFFIX" >> "$GITHUB_ENV"
- name: Build with Maven
run: mvn -B clean ${{ matrix.mvn-goal }} -Drepo.snapshots.url=${{ secrets.SNAPSHOTS_URL }} -Dsha1=$BRANCH_SUFFIX
run: |
mvn -B clean deploy \
-Drepo.snapshots.url=${{ secrets.SNAPSHOTS_URL }} \
-Dsha1=$BRANCH_SUFFIX \
-Djava.version=${{ matrix.java-version }}
- name: Run Demo App
run: |
Expand Down
18 changes: 9 additions & 9 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -143,15 +143,15 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>${maven-site-plugin.version}</version>
<configuration>
<locales>en</locales>
<outputEncoding>UTF-8</outputEncoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>${maven-site-plugin.version}</version>
<configuration>
<locales>en</locales>
<outputEncoding>UTF-8</outputEncoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
Expand Down

0 comments on commit abc09fc

Please sign in to comment.