Skip to content

Commit 2076b4f

Browse files
committed
(ci) add task for package publish at nyaaci
1 parent 089dc49 commit 2076b4f

File tree

3 files changed

+28
-12
lines changed

3 files changed

+28
-12
lines changed

.github/workflows/maven-publish-ghpkg.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
server-id: 'github-package'
3838

3939
- name: Publish to GitHub Packages Apache Maven
40-
run: mvn --batch-mode deploy
40+
run: mvn deploy --batch-mode -Pdeploy-github
4141
env:
4242
GITHUB_MAVEN_URL: https://maven.pkg.github.com/${{github.repository}}
4343
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

Jenkinsfile

+4-3
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,18 @@ pipeline {
33
stages {
44
stage('Build') {
55
tools {
6-
jdk "jdk17"
6+
jdk "jdk21"
7+
maven "apache-maven-3.9.9"
78
}
89
steps {
9-
sh 'mvn -DmavenLocalDistDir=${MAVEN_DIR} deploy'
10+
sh 'mvn deploy --batch-mode -Pdeploy-local'
1011
}
1112
}
1213
}
1314

1415
post {
1516
always {
16-
archiveArtifacts artifacts: 'target/*.jar', fingerprint: true
17+
archiveArtifacts artifacts: 'target/ecore-*.jar', fingerprint: true
1718
cleanWs()
1819
}
1920
}

pom.xml

+23-8
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
<maven.compiler.target>21</maven.compiler.target>
1414
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
1515
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
16+
<github.package.url>${env.GITHUB_MAVEN_URL}</github.package.url>
17+
<maven.local.dir>${env.MAVEN_DIR}</maven.local.dir>
1618
</properties>
1719

1820
<repositories>
@@ -116,12 +118,25 @@
116118
</resource>
117119
</resources>
118120
</build>
119-
120-
<distributionManagement>
121-
<repository>
122-
<id>github-package</id>
123-
<url>${env.GITHUB_MAVEN_URL}</url>
124-
<!-- refer to .github/workflows/maven-publish-ghpkg.yml -->
125-
</repository>
126-
</distributionManagement>
121+
<profiles>
122+
<profile>
123+
<id>deploy-github</id>
124+
<distributionManagement>
125+
<repository>
126+
<id>github-package</id>
127+
<url>${github.package.url}</url>
128+
<!-- refer to .github/workflows/github-publishpackage.yml -->
129+
</repository>
130+
</distributionManagement>
131+
</profile>
132+
<profile>
133+
<id>deploy-local</id>
134+
<distributionManagement>
135+
<repository>
136+
<id>laven-local</id>
137+
<url>file://${maven.local.dir}</url>
138+
</repository>
139+
</distributionManagement>
140+
</profile>
141+
</profiles>
127142
</project>

0 commit comments

Comments
 (0)