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:
|
||||
build:
|
||||
if: "contains(github.event.head_commit.message, vars.SKIP_CI_PREFIX) != true"
|
||||
|
||||
runs-on: runner
|
||||
container:
|
||||
image: catthehacker/ubuntu:act-latest
|
||||
steps:
|
||||
- uses: RouxAntoine/checkout@v4.1.8
|
||||
- uses: actions/setup-java@v4
|
||||
- name: Checkout repository
|
||||
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:
|
||||
distribution: 'temurin'
|
||||
java-version: '21'
|
||||
- run: ./mvnw verify jib:build
|
||||
commit_message: "${{ vars.SKIP_CI_PREFIX }} Push updated changelog"
|
||||
|
16
.github/workflows/pull-request.yaml
vendored
16
.github/workflows/pull-request.yaml
vendored
@ -6,12 +6,12 @@ on:
|
||||
jobs:
|
||||
build:
|
||||
runs-on: runner
|
||||
container:
|
||||
image: catthehacker/ubuntu:act-latest
|
||||
steps:
|
||||
- uses: RouxAntoine/checkout@v4.1.8
|
||||
- uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: 'temurin'
|
||||
java-version: '21'
|
||||
- run: ./mvnw verify
|
||||
- name: Checkout repository
|
||||
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: Run test suite
|
||||
run: ./mvnw verify
|
||||
|
@ -1 +1,13 @@
|
||||
# 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>
|
||||
<configuration>
|
||||
<to>
|
||||
<image>container.localdomain:5000/${artifactId}</image>
|
||||
<image>container.localdomain/${project.artifactId}</image>
|
||||
</to>
|
||||
<from>
|
||||
<image>eclipse-temurin:21.0.1_12-jdk</image>
|
||||
@ -126,7 +126,16 @@
|
||||
<artifactId>maven-failsafe-plugin</artifactId>
|
||||
</plugin>
|
||||
</plugins>
|
||||
|
||||
</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>
|
||||
|
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