Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug/fix release #83

Closed
wants to merge 25 commits into from
Closed
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
59096a1
:bug: root pom fix missing release properties
simonhir Aug 16, 2024
adabd5a
:bug: ci rm deploy skip
simonhir Aug 16, 2024
412cdcc
:bug: ci create release notes
simonhir Aug 16, 2024
d66e2f4
Merge branch 'refs/heads/main' into bug/fix-release
simonhir Aug 16, 2024
0bc40c1
:bug: pom add missing url
simonhir Aug 16, 2024
ce7c1af
:construction_worker: ci disable snapshot release by default
simonhir Aug 16, 2024
e864c8d
Merge branch 'refs/heads/main' into bug/fix-release
simonhir Aug 16, 2024
115db0e
:bug: pom add distribution management
simonhir Aug 16, 2024
01ad789
:construction_worker: ci maven build hide transfer progress
simonhir Aug 16, 2024
e543ad3
Revert ":construction_worker: ci maven build hide transfer progress"
simonhir Aug 16, 2024
4e04528
Revert ":bug: pom add distribution management"
simonhir Aug 16, 2024
3557b06
:bug: gateway add missing maven-release-plugin
simonhir Aug 16, 2024
39dcc03
:recycle: make gateway pom same as integrations
simonhir Aug 16, 2024
34d419e
Merge branch 'refs/heads/main' into bug/fix-release
simonhir Sep 2, 2024
3e9e2dc
:bug: wip fix release disable image build and pr
simonhir Sep 2, 2024
6c4bbbd
:bug: wip release integrations only
simonhir Sep 2, 2024
301d632
:bug: wip fix release disable github release
simonhir Sep 2, 2024
61fd9be
Revert ":bug: wip release integrations only"
simonhir Sep 2, 2024
ca7b370
:bug: wip release integrations only via pom
simonhir Sep 2, 2024
8e823c8
:bug: wip release pom add repositories
simonhir Sep 2, 2024
e86f997
:bug: wip release pom add distributionManagement
simonhir Sep 2, 2024
82d7cc5
:recycle: wip release root pom as parent
simonhir Sep 2, 2024
b093f57
Revert ":bug: wip release integrations only via pom"
simonhir Sep 2, 2024
18cde99
:recycle: wip release mv central release plugin to root pom
simonhir Sep 2, 2024
7d533b3
:recycle: wip release mv build to root pom
simonhir Sep 2, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
134 changes: 67 additions & 67 deletions .github/workflows/maven.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,71 +62,71 @@ jobs:
name: target
path: "**/target"
retention-days: 5
- name: Push changes to new branch
if: ${{ inputs.snapshot-release == false }}
run: |
git checkout -b ${{ github.ref_name }}-version-bump
git push --force origin ${{ github.ref_name }}-version-bump
- name: Create pull request
if: ${{ inputs.snapshot-release == false }}
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
with:
script: |
const { repo, owner } = context.repo;
const pullResult = await github.rest.pulls.create({
title: 'chore: bump release version ${{ github.ref_name }}',
owner,
repo,
head: '${{ github.ref_name }}-version-bump',
base: '${{ github.ref_name }}',
body: [
'This PR is auto-generated'
].join('\n')
});
await github.rest.issues.addAssignees({
owner,
repo,
issue_number: pullResult.data.number,
assignees: ['${{ github.actor }}'],
});
console.log(`Pull Request created: ${pullResult.data.html_url}`);
# - name: Push changes to new branch
# if: ${{ inputs.snapshot-release == false }}
# run: |
# git checkout -b ${{ github.ref_name }}-version-bump
# git push --force origin ${{ github.ref_name }}-version-bump
# - name: Create pull request
# if: ${{ inputs.snapshot-release == false }}
# uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
# with:
# script: |
# const { repo, owner } = context.repo;
# const pullResult = await github.rest.pulls.create({
# title: 'chore: bump release version ${{ github.ref_name }}',
# owner,
# repo,
# head: '${{ github.ref_name }}-version-bump',
# base: '${{ github.ref_name }}',
# body: [
# 'This PR is auto-generated'
# ].join('\n')
# });
# await github.rest.issues.addAssignees({
# owner,
# repo,
# issue_number: pullResult.data.number,
# assignees: ['${{ github.actor }}'],
# });
# console.log(`Pull Request created: ${pullResult.data.html_url}`);

build-images:
if: inputs.build-images == true
needs: build-maven
runs-on: ubuntu-latest
strategy:
matrix:
include:
- name: refarch-gateway
path: ./refarch-gateway
- name: s3-integration-rest-service
path: ./refarch-integrations/refarch-s3-integration/refarch-s3-integration-rest/refarch-s3-integration-rest-service
steps:
- name: Checkout code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Download target artifacts
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: target
- name: Login to Registry
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract metadata (tags, labels) for image
id: meta
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # v5.5.1
with:
images: "${{ env.REGISTRY }}/${{ github.repository }}/${{ matrix.name }}"
tags: |
type=raw,value=${{ inputs.release-version }}
type=raw,value=latest,enable=${{ inputs.snapshot-release == false }}
- name: Build and push image
uses: docker/build-push-action@5cd11c3a4ced054e52742c5fd54dca954e0edd85 # v6.7.0
with:
context: ${{ matrix.path }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
# build-images:
# if: inputs.build-images == true
# needs: build-maven
# runs-on: ubuntu-latest
# strategy:
# matrix:
# include:
# - name: refarch-gateway
# path: ./refarch-gateway
# - name: s3-integration-rest-service
# path: ./refarch-integrations/refarch-s3-integration/refarch-s3-integration-rest/refarch-s3-integration-rest-service
# steps:
# - name: Checkout code
# uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
# - name: Download target artifacts
# uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
# with:
# name: target
# - name: Login to Registry
# uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
# with:
# registry: ${{ env.REGISTRY }}
# username: ${{ github.actor }}
# password: ${{ secrets.GITHUB_TOKEN }}
# - name: Extract metadata (tags, labels) for image
# id: meta
# uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # v5.5.1
# with:
# images: "${{ env.REGISTRY }}/${{ github.repository }}/${{ matrix.name }}"
# tags: |
# type=raw,value=${{ inputs.release-version }}
# type=raw,value=latest,enable=${{ inputs.snapshot-release == false }}
# - name: Build and push image
# uses: docker/build-push-action@5cd11c3a4ced054e52742c5fd54dca954e0edd85 # v6.7.0
# with:
# context: ${{ matrix.path }}
# push: true
# tags: ${{ steps.meta.outputs.tags }}
# labels: ${{ steps.meta.outputs.labels }}
28 changes: 14 additions & 14 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
snapshot-release:
description: 'Snapshot release?'
type: boolean
default: true
default: false
release-version:
description: 'Release version'
type: string
Expand All @@ -27,16 +27,16 @@ jobs:
release-version: ${{ inputs.release-version }}
secrets: inherit

create-github-release:
if: ${{ inputs.snapshot-release == false }}
needs: build
runs-on: ubuntu-latest
steps:
- name: Create GitHub Release
id: create_release
uses: softprops/action-gh-release@c062e08bd532815e2082a85e87e3ef29c3e6d191 # v2.0.8
with:
tag_name: ${{ github.event.inputs.release-version }}
draft: false
prerelease: false
generate_release_notes: true
# create-github-release:
# if: ${{ inputs.snapshot-release == false }}
# needs: build
# runs-on: ubuntu-latest
# steps:
# - name: Create GitHub Release
# id: create_release
# uses: softprops/action-gh-release@c062e08bd532815e2082a85e87e3ef29c3e6d191 # v2.0.8
# with:
# tag_name: ${{ github.event.inputs.release-version }}
# draft: false
# prerelease: false
# generate_release_notes: true
16 changes: 15 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@
<artifactId>refarch</artifactId>
<name>refarch</name>
<description>Collection of different ready to use RefArch components</description>
<url>https://github.com/it-at-m/refarch.git</url>
<version>1.1.0-SNAPSHOT</version>
<packaging>pom</packaging>

<modules>
<module>refarch-gateway</module>
<!--<module>refarch-gateway</module>-->
<module>refarch-integrations</module>
</modules>

Expand All @@ -33,4 +34,17 @@
<url>https://github.com/it-at-m</url>
</developer>
</developers>

<repositories>
<repository>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
<id>central</id>
<url>http://central</url>
</repository>
Fixed Show fixed Hide fixed
</repositories>
</project>
95 changes: 95 additions & 0 deletions refarch-gateway/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<artifactId>refarch-gateway</artifactId>
<name>refarch-gateway</name>
<description>Ready to use RefArch gateway based on Spring Cloud Gateway</description>
<url>https://github.com/it-at-m/refarch.git</url>
<version>1.1.0-SNAPSHOT</version>
<packaging>jar</packaging>

Expand All @@ -34,6 +35,11 @@
<spotless-maven-plugin.version>2.34.0</spotless-maven-plugin.version>
<itm-java-codeformat.version>1.0.10</itm-java-codeformat.version>

<!-- Release -->
<central-publishing-maven-plugin.version>0.5.0</central-publishing-maven-plugin.version>
<maven-release-plugin.version>3.1.1</maven-release-plugin.version>
<maven-gpg-plugin.version>3.2.5</maven-gpg-plugin.version>

<!-- Testing -->
<jacoco.version>0.8.12</jacoco.version>

Expand Down Expand Up @@ -145,6 +151,8 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
<annotationProcessorPaths>
<path>
<groupId>org.projectlombok</groupId>
Expand All @@ -154,6 +162,33 @@
</annotationProcessorPaths>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<configuration>
<doclint>accessibility,html,reference,syntax</doclint>
</configuration>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- Testing -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down Expand Up @@ -181,6 +216,19 @@
</execution>
</executions>
</plugin>
<!-- Release -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>${maven-release-plugin.version}</version>
<configuration>
<autoVersionSubmodules>true</autoVersionSubmodules>
<useReleaseProfile>false</useReleaseProfile>
<releaseProfiles>release</releaseProfiles>
<goals>deploy</goals>
<tagNameFormat>@{project.version}</tagNameFormat>
</configuration>
</plugin>

<!-- Codeformatter Spotless -->
<plugin>
Expand Down Expand Up @@ -218,6 +266,53 @@
</plugins>
</build>

<profiles>
<profile>
<id>release</id>
<build>
<plugins>
<!-- Central Portal Publishing Plugin -->
<plugin>
<groupId>org.sonatype.central</groupId>
<artifactId>central-publishing-maven-plugin</artifactId>
<version>${central-publishing-maven-plugin.version}</version>
<extensions>true</extensions>
<configuration>
<autoPublish>true</autoPublish>
<deploymentName>${project.groupId}:${project.artifactId}:${project.version}</deploymentName>
<excludeArtifacts>
<!-- Exclude services -->
<artifact>refarch-gateway</artifact>
</excludeArtifacts>
</configuration>
</plugin>
<!-- GPG plugin -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>${maven-gpg-plugin.version}</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
<configuration>
<!-- Prevent `gpg` from using pinentry programs -->
<gpgArguments>
<arg>--pinentry-mode</arg>
<arg>loopback</arg>
</gpgArguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>

<scm>
<url>https://github.com/it-at-m/refarch.git</url>
<connection>scm:git:https://github.com/it-at-m/refarch.git</connection>
Expand Down
2 changes: 2 additions & 0 deletions refarch-integrations/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<artifactId>refarch-integrations</artifactId>
<name>refarch-integrations</name>
<description>Collection of different ready to use RefArch integrations</description>
<url>https://github.com/it-at-m/refarch.git</url>
<version>1.1.0-SNAPSHOT</version>
<packaging>pom</packaging>

Expand Down Expand Up @@ -208,6 +209,7 @@
<useReleaseProfile>false</useReleaseProfile>
<releaseProfiles>release</releaseProfiles>
<goals>deploy</goals>
<tagNameFormat>@{project.version}</tagNameFormat>
</configuration>
</plugin>

Expand Down
Loading