Skip to content

Commit

Permalink
(ci) add task for package publish at nyaaci
Browse files Browse the repository at this point in the history
  • Loading branch information
Lori3f6 committed Aug 20, 2024
1 parent 089dc49 commit 2076b4f
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/maven-publish-ghpkg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
server-id: 'github-package'

- name: Publish to GitHub Packages Apache Maven
run: mvn --batch-mode deploy
run: mvn deploy --batch-mode -Pdeploy-github
env:
GITHUB_MAVEN_URL: https://maven.pkg.github.com/${{github.repository}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
Expand Down
7 changes: 4 additions & 3 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,18 @@ pipeline {
stages {
stage('Build') {
tools {
jdk "jdk17"
jdk "jdk21"
maven "apache-maven-3.9.9"
}
steps {
sh 'mvn -DmavenLocalDistDir=${MAVEN_DIR} deploy'
sh 'mvn deploy --batch-mode -Pdeploy-local'
}
}
}

post {
always {
archiveArtifacts artifacts: 'target/*.jar', fingerprint: true
archiveArtifacts artifacts: 'target/ecore-*.jar', fingerprint: true
cleanWs()
}
}
Expand Down
31 changes: 23 additions & 8 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
<maven.compiler.target>21</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<github.package.url>${env.GITHUB_MAVEN_URL}</github.package.url>
<maven.local.dir>${env.MAVEN_DIR}</maven.local.dir>
</properties>

<repositories>
Expand Down Expand Up @@ -116,12 +118,25 @@
</resource>
</resources>
</build>

<distributionManagement>
<repository>
<id>github-package</id>
<url>${env.GITHUB_MAVEN_URL}</url>
<!-- refer to .github/workflows/maven-publish-ghpkg.yml -->
</repository>
</distributionManagement>
<profiles>
<profile>
<id>deploy-github</id>
<distributionManagement>
<repository>
<id>github-package</id>
<url>${github.package.url}</url>
<!-- refer to .github/workflows/github-publishpackage.yml -->
</repository>
</distributionManagement>
</profile>
<profile>
<id>deploy-local</id>
<distributionManagement>
<repository>
<id>laven-local</id>
<url>file://${maven.local.dir}</url>
</repository>
</distributionManagement>
</profile>
</profiles>
</project>

0 comments on commit 2076b4f

Please sign in to comment.