Skip to content

Commit 06814ae

Browse files
committed
github deploy
1 parent cfd8c7f commit 06814ae

6 files changed

Lines changed: 58 additions & 90 deletions

File tree

.github/workflows/maven-build.yml

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# This workflow will build a package using Maven and then publish it to GitHub packages when a release is created
22
# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#apache-maven-with-a-settings-path
33

4-
name: Maven Package
4+
name: Maven Package build
55

6-
on: [ push, pull_request ]
6+
on: [ push, pull_request, workflow_dispatch ]
77

88
jobs:
99
build:
@@ -19,19 +19,10 @@ jobs:
1919
uses: actions/setup-java@v2
2020
with:
2121
java-version: '17'
22-
distribution: 'temurin'
23-
# server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
24-
# settings-path: ${{ github.workspace }}/settings.xml # location for the settings.xml file
22+
distribution: 'adopt'
2523

2624
- name: Build with Maven
2725
env:
28-
GH_MAVEN_REGISTRY_USER: ${{ secrets.PRIVATE_ACCESS_TOKEN_USER }}
29-
GH_MAVEN_REGISTRY_ACCESS_TOKEN: ${{ secrets.PRIVATE_ACCESS_TOKEN }}
30-
run: mvn -s settings.xml install
31-
32-
- name: Deploy to registry
33-
env:
34-
GH_MAVEN_REGISTRY_USER: ${{ secrets.PRIVATE_ACCESS_TOKEN_USER }}
35-
GH_MAVEN_REGISTRY_ACCESS_TOKEN: ${{ secrets.PRIVATE_ACCESS_TOKEN }}
36-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37-
run: mvn -s settings.xml deploy -DskipTests
26+
GH_MAVEN_REGISTRY_USER: ${{ secrets.GH_MAVEN_REGISTRY_USER }}
27+
GH_MAVEN_REGISTRY_ACCESS_TOKEN: ${{ secrets.GH_MAVEN_REGISTRY_ACCESS_TOKEN }}
28+
run: mvn -s settings.xml -B package
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# This workflow will build a package using Maven and then publish it to GitHub packages when a release is created
2+
# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#apache-maven-with-a-settings-path
3+
4+
name: Maven Package deploy
5+
6+
on:
7+
release:
8+
types: [ created ]
9+
10+
jobs:
11+
build:
12+
13+
runs-on: ubuntu-latest
14+
permissions:
15+
contents: read
16+
packages: write
17+
18+
steps:
19+
- uses: actions/checkout@v2
20+
- name: Set up JDK 17
21+
uses: actions/setup-java@v2
22+
with:
23+
java-version: '17'
24+
distribution: 'adopt'
25+
26+
- name: Build with Maven
27+
env:
28+
GH_MAVEN_REGISTRY_USER: ${{ secrets.GH_MAVEN_REGISTRY_USER }}
29+
GH_MAVEN_REGISTRY_ACCESS_TOKEN: ${{ secrets.GH_MAVEN_REGISTRY_ACCESS_TOKEN }}
30+
run: mvn -B package -s settings.xml
31+
32+
- name: Publish to GitHub Packages Apache Maven
33+
env:
34+
GH_MAVEN_REGISTRY_USER: ${{ secrets.GH_MAVEN_REGISTRY_USER }}
35+
GH_MAVEN_REGISTRY_ACCESS_TOKEN: ${{ secrets.GH_MAVEN_REGISTRY_ACCESS_TOKEN }}
36+
run: mvn deploy -s settings.xml

.gitlab-ci.yml

Lines changed: 0 additions & 30 deletions
This file was deleted.

ci_settings.xml

Lines changed: 0 additions & 16 deletions
This file was deleted.

pom.xml

Lines changed: 13 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,30 +5,21 @@
55
<packaging>jar</packaging>
66
<artifactId>globs-xml</artifactId>
77
<name>xml utils</name>
8-
<version>4.1-SNAPSHOT</version>
8+
<version>4.1.0</version>
99

1010
<repositories>
1111
<repository>
12-
<id>github-marc</id>
13-
<url>https://maven.pkg.github.com/MarcGuiot/*</url>
14-
</repository>
15-
<repository>
16-
<id>central</id>
17-
<url>https://repo1.maven.org/maven2</url>
12+
<id>github-globsframework</id>
13+
<url>https://maven.pkg.github.com/globsframework/*</url>
1814
</repository>
1915
</repositories>
2016

2117
<distributionManagement>
2218
<repository>
23-
<id>github</id>
19+
<id>github-globsframework</id>
2420
<name>GitHub Packages</name>
2521
<url>https://maven.pkg.github.com/${env.GITHUB_REPOSITORY}</url>
2622
</repository>
27-
<snapshotRepository>
28-
<id>github</id>
29-
<name>GitHub Packages</name>
30-
<url>https://maven.pkg.github.com/${env.GITHUB_REPOSITORY}</url>
31-
</snapshotRepository>
3223
</distributionManagement>
3324

3425
<build>
@@ -101,30 +92,30 @@
10192
<dependency>
10293
<groupId>org.globsframework</groupId>
10394
<artifactId>globs</artifactId>
104-
<version>4.1-SNAPSHOT</version>
95+
<version>4.1.0</version>
96+
</dependency>
97+
<dependency>
98+
<groupId>org.globsframework</groupId>
99+
<artifactId>saxstack</artifactId>
100+
<version>4.1.0</version>
105101
</dependency>
106102
<dependency>
107103
<groupId>org.globsframework</groupId>
108104
<artifactId>globs</artifactId>
109-
<version>4.1-SNAPSHOT</version>
105+
<version>4.1.0</version>
110106
<scope>test</scope>
111107
<type>test-jar</type>
112108
</dependency>
113109
<dependency>
114110
<groupId>junit</groupId>
115111
<artifactId>junit</artifactId>
116-
<version>4.8.2</version>
112+
<version>4.13.2</version>
117113
<scope>test</scope>
118114
</dependency>
119-
<dependency>
120-
<groupId>org.globsframework</groupId>
121-
<artifactId>saxstack</artifactId>
122-
<version>4.1-SNAPSHOT</version>
123-
</dependency>
124115
<dependency>
125116
<groupId>xerces</groupId>
126117
<artifactId>xercesImpl</artifactId>
127-
<version>2.11.0</version>
118+
<version>2.12.2</version>
128119
<scope>test</scope>
129120
</dependency>
130121
<dependency>

settings.xml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
1-
<settings>
1+
<settings xmlns="http://maven.apache.org/SETTINGS/1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.1.0 http://maven.apache.org/xsd/settings-1.1.0.xsd">
23
<servers>
34
<server>
4-
<id>github</id>
5-
<username>${env.GH_MAVEN_REGISTRY_USER}</username>
6-
<password>${env.GH_MAVEN_REGISTRY_ACCESS_TOKEN}</password>
7-
</server>
8-
<server>
9-
<id>github-marc</id>
5+
<id>github-globsframework</id>
106
<username>${env.GH_MAVEN_REGISTRY_USER}</username>
117
<password>${env.GH_MAVEN_REGISTRY_ACCESS_TOKEN}</password>
128
</server>

0 commit comments

Comments
 (0)