feat: github action deployement

This commit is contained in:
Etienne Dx 2021-09-09 11:16:45 +02:00
parent 72af7ce8f5
commit 17f80c33d7
3 changed files with 23 additions and 29 deletions

View File

@ -1,34 +1,20 @@
# This workflow will build a package using Maven and then publish it to GitHub packages when a release is created name: Publish package to GitHub Packages
# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#apache-maven-with-a-settings-path
name: Maven Package
on: on:
release: release:
types: [created] types: [created]
jobs: jobs:
build: publish:
runs-on: ubuntu-latest runs-on: ubuntu-latest
permissions: permissions:
contents: read contents: read
packages: write packages: write
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Set up JDK 16 - uses: actions/setup-java@v2
uses: actions/setup-java@v2
with: with:
java-version: '16' java-version: '16'
distribution: 'adopt' distribution: 'adopt'
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml - name: Publish package
settings-path: ${{ github.workspace }} # location for the settings.xml file run: mvn --batch-mode deploy
- name: Build with Maven
run: mvn -B package --file pom.xml
- name: Publish to GitHub Packages Apache Maven
run: mvn deploy -s $GITHUB_WORKSPACE/settings.xml
env: env:
GITHUB_TOKEN: ${{ github.token }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

1
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1 @@
{}

View File

@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>Me.EtienneDx</groupId> <groupId>Me.EtienneDx</groupId>
<artifactId>RealEstate</artifactId> <artifactId>RealEstate</artifactId>
<version>1.2.2</version> <version>1.3.0</version>
<name>RealEstate</name> <name>RealEstate</name>
<description>A spigot plugin for selling, renting and leasing GriefPrevention claims</description> <description>A spigot plugin for selling, renting and leasing GriefPrevention claims</description>
<build> <build>
@ -57,6 +57,13 @@
</plugin> </plugin>
</plugins> </plugins>
</build> </build>
<distributionManagement>
<repository>
<id>github</id>
<name>GitHub Packages</name>
<url>https://maven.pkg.github.com/EtienneDx/RealEstate</url>
</repository>
</distributionManagement>
<repositories> <repositories>
<repository> <repository>
<id>spigot-repo</id> <id>spigot-repo</id>