mirror of
https://github.com/stleary/JSON-java.git
synced 2025-08-03 03:15:32 -04:00
Add new deployment pipeline.
This should only trigger when a release is published
This commit is contained in:
parent
f346203cd6
commit
7c4f98c42c
40
.github/workflows/deployment.yml
vendored
Normal file
40
.github/workflows/deployment.yml
vendored
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
# For more information see: https://docs.github.com/en/actions/learn-github-actions or https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions
|
||||||
|
|
||||||
|
name: Deployment workflow
|
||||||
|
|
||||||
|
on:
|
||||||
|
release:
|
||||||
|
types: [published]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
publish:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
packages: write
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Set up Java for publishing to Maven Central Repository
|
||||||
|
uses: actions/setup-java@v3
|
||||||
|
with:
|
||||||
|
# Use lowest supported LTS Java version
|
||||||
|
java-version: '8'
|
||||||
|
distribution: 'temurin'
|
||||||
|
server-id: ossrh
|
||||||
|
server-username: MAVEN_USERNAME
|
||||||
|
server-password: MAVEN_PASSWORD
|
||||||
|
- name: Publish to the Maven Central Repository
|
||||||
|
run: mvn --batch-mode deploy
|
||||||
|
env:
|
||||||
|
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
|
||||||
|
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
|
||||||
|
# - name: Set up Java for publishing to GitHub Packages
|
||||||
|
# uses: actions/setup-java@v3
|
||||||
|
# with:
|
||||||
|
# # Use lowest supported LTS Java version
|
||||||
|
# java-version: '8'
|
||||||
|
# distribution: 'temurin'
|
||||||
|
# - name: Publish to GitHub Packages
|
||||||
|
# run: mvn --batch-mode deploy
|
||||||
|
# env:
|
||||||
|
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
7
pom.xml
7
pom.xml
@ -52,6 +52,13 @@
|
|||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
|
<distributionManagement>
|
||||||
|
<repository>
|
||||||
|
<id>ossrh</id>
|
||||||
|
<name>Central Repository OSSRH</name>
|
||||||
|
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
|
||||||
|
</repository>
|
||||||
|
</distributionManagement>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user