Skip to content

Commit

Permalink
Build artifact
Browse files Browse the repository at this point in the history
  • Loading branch information
ReuDa committed Dec 19, 2024
1 parent 2d35f04 commit 528fe7b
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 108 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Build

on:
push:
branches:
- "**"

jobs:
build:
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: zulu
java-version: 11
cache: maven

- name: Import GPG key
id: import_gpg
uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.MAVEN_GPG_PRIVATE_KEY_PASSWORD }}

- name: Bump version without tagging
if: github.ref == 'refs/heads/trunk'
id: git_tag_dry_run
uses: anothrNick/github-tag-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DEFAULT_BUMP: "patch"
DRY_RUN: true

- name: "mvn deploy -Prelease"
if: github.ref == 'refs/heads/trunk'
#Workaround: -Dmaven.resolver.transport=wagon for failed deployments https://github.com/community/community/discussions/49001
run: mvn -Drevision=${{steps.git_tag_dry_run.outputs.new_tag}} -Dgpg.passphrase=${{ secrets.MAVEN_GPG_PRIVATE_KEY_PASSWORD }} deploy -B -U -Prelease -Dmaven.resolver.transport=wagon
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Bump version again and push git tag
if: github.ref == 'refs/heads/trunk'
id: git_tag
uses: anothrNick/github-tag-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DEFAULT_BUMP: "patch"
72 changes: 0 additions & 72 deletions .github/workflows/codeql.yml

This file was deleted.

54 changes: 18 additions & 36 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>io.github.ci-cmg</groupId>
<groupId>com.steadybit</groupId>
<artifactId>aws-s3-outputstream</artifactId>
<version>1.2.0-SNAPSHOT</version>
<version>${revision}</version>
<packaging>jar</packaging>

<name>${project.groupId}:${project.artifactId}</name>
Expand Down Expand Up @@ -34,13 +34,15 @@
</scm>

<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
<repository>
<id>github</id>
<name>GitHub steadybit Apache Maven Packages</name>
<url>https://maven.pkg.github.com/steadybit/aws-s3-outputstream</url>
</repository>
</distributionManagement>

<properties>
<revision>1.0.0-SNAPSHOT</revision>
<maven.compiler.release>8</maven.compiler.release>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
Expand Down Expand Up @@ -176,32 +178,6 @@
</pluginManagement>

<plugins>

<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.8</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<configuration>
<autoVersionSubmodules>true</autoVersionSubmodules>
<useReleaseProfile>false</useReleaseProfile>
<releaseProfiles>release,site-publish</releaseProfiles>
<goals>deploy site</goals>
<tagNameFormat>v@{project.version}</tagNameFormat>
<arguments>-Pdep-check -D${sign.serverId}</arguments>
</configuration>
</plugin>

<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
Expand Down Expand Up @@ -321,16 +297,22 @@
</executions>
</plugin>
<plugin>
<groupId>org.simplify4u.plugins</groupId>
<artifactId>sign-maven-plugin</artifactId>
<version>1.0.0</version>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>3.1.0</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
<configuration>
<skipNoKey>false</skipNoKey>
<!-- This is necessary for gpg to not try to use the pinentry programs -->
<gpgArguments>
<arg>--pinentry-mode</arg>
<arg>loopback</arg>
</gpgArguments>
</configuration>
</execution>
</executions>
Expand Down

0 comments on commit 528fe7b

Please sign in to comment.