feature: publish jar to the maven artifact registry on gitea
This commit is contained in:
parent
ecf0dfca21
commit
68a5117669
30
.github/workflows/main.yaml
vendored
30
.github/workflows/main.yaml
vendored
@ -7,13 +7,29 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
if: "contains(github.event.head_commit.message, vars.SKIP_CI_PREFIX) != true"
|
||||||
|
|
||||||
runs-on: runner
|
runs-on: runner
|
||||||
container:
|
|
||||||
image: catthehacker/ubuntu:act-latest
|
|
||||||
steps:
|
steps:
|
||||||
- uses: RouxAntoine/checkout@v4.1.8
|
- name: Checkout repository
|
||||||
- uses: actions/setup-java@v4
|
uses: https://antoine-roux.tk/projects/actions/checkout@v3.5.4
|
||||||
|
|
||||||
|
- name: Setup java
|
||||||
|
uses: https://antoine-roux.tk/projects/actions/setup-java@v1.1.0
|
||||||
|
|
||||||
|
- name: Deploy container artifact
|
||||||
|
run: ./mvnw compile jib:build
|
||||||
|
|
||||||
|
- name: Deploy maven jar artifact
|
||||||
|
run: ./mvnw deploy
|
||||||
|
env:
|
||||||
|
MAVEN_ARGS: "-s ${{ gitea.workspace }}/settings.xml"
|
||||||
|
TOKEN_REGISTRY: ${{ secrets.TOKEN_REGISTRY }}
|
||||||
|
|
||||||
|
- name: Auto generate changelog
|
||||||
|
uses: https://antoine-roux.tk/projects/actions/auto-changie@v1.0.1
|
||||||
|
|
||||||
|
- name: Push changelog
|
||||||
|
uses: stefanzweifel/git-auto-commit-action@v5
|
||||||
with:
|
with:
|
||||||
distribution: 'temurin'
|
commit_message: "${{ vars.SKIP_CI_PREFIX }} Push updated changelog"
|
||||||
java-version: '21'
|
|
||||||
- run: ./mvnw verify jib:build
|
|
||||||
|
16
.github/workflows/pull-request.yaml
vendored
16
.github/workflows/pull-request.yaml
vendored
@ -6,12 +6,12 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: runner
|
runs-on: runner
|
||||||
container:
|
|
||||||
image: catthehacker/ubuntu:act-latest
|
|
||||||
steps:
|
steps:
|
||||||
- uses: RouxAntoine/checkout@v4.1.8
|
- name: Checkout repository
|
||||||
- uses: actions/setup-java@v4
|
uses: https://antoine-roux.tk/projects/actions/checkout@v3.5.4
|
||||||
with:
|
|
||||||
distribution: 'temurin'
|
- name: Setup java
|
||||||
java-version: '21'
|
uses: https://antoine-roux.tk/projects/actions/setup-java@v1.1.0
|
||||||
- run: ./mvnw verify
|
|
||||||
|
- name: Run test suite
|
||||||
|
run: ./mvnw verify
|
||||||
|
@ -1 +1,13 @@
|
|||||||
# Usage documentation
|
# Usage documentation
|
||||||
|
|
||||||
|
to publish a docker image of this application use
|
||||||
|
|
||||||
|
```shell
|
||||||
|
./mvnw compile jib:build
|
||||||
|
```
|
||||||
|
|
||||||
|
to publish maven jar of this application use
|
||||||
|
|
||||||
|
```shell
|
||||||
|
./mvnw deploy
|
||||||
|
```
|
||||||
|
13
pom.xml
13
pom.xml
@ -72,7 +72,7 @@
|
|||||||
<version>${jib-maven-plugin.version}</version>
|
<version>${jib-maven-plugin.version}</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<to>
|
<to>
|
||||||
<image>container.localdomain:5000/${artifactId}</image>
|
<image>container.localdomain/${project.artifactId}</image>
|
||||||
</to>
|
</to>
|
||||||
<from>
|
<from>
|
||||||
<image>eclipse-temurin:21.0.1_12-jdk</image>
|
<image>eclipse-temurin:21.0.1_12-jdk</image>
|
||||||
@ -126,7 +126,16 @@
|
|||||||
<artifactId>maven-failsafe-plugin</artifactId>
|
<artifactId>maven-failsafe-plugin</artifactId>
|
||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
|
|
||||||
</build>
|
</build>
|
||||||
|
|
||||||
|
<distributionManagement>
|
||||||
|
<repository>
|
||||||
|
<id>gitea</id>
|
||||||
|
<url>https://antoine-roux.tk/projects/api/packages/java-template/maven</url>
|
||||||
|
</repository>
|
||||||
|
<snapshotRepository>
|
||||||
|
<id>gitea</id>
|
||||||
|
<url>https://antoine-roux.tk/projects/api/packages/java-template/maven</url>
|
||||||
|
</snapshotRepository>
|
||||||
|
</distributionManagement>
|
||||||
</project>
|
</project>
|
||||||
|
17
settings.xml
Normal file
17
settings.xml
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 https://maven.apache.org/xsd/settings-1.0.0.xsd">
|
||||||
|
<servers>
|
||||||
|
<server>
|
||||||
|
<id>gitea</id>
|
||||||
|
<configuration>
|
||||||
|
<httpHeaders>
|
||||||
|
<property>
|
||||||
|
<name>Authorization</name>
|
||||||
|
<value>token ${env.TOKEN_REGISTRY}</value>
|
||||||
|
</property>
|
||||||
|
</httpHeaders>
|
||||||
|
</configuration>
|
||||||
|
</server>
|
||||||
|
</servers>
|
||||||
|
</settings>
|
Loading…
x
Reference in New Issue
Block a user