Skip to content

Commit

Permalink
Publish package to GitHub Packages
Browse files Browse the repository at this point in the history
  • Loading branch information
wode490390 committed Jun 8, 2024
1 parent 0c3a2af commit b11245e
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Publish package to GitHub Packages

on:
push:
branches:
- master
workflow_dispatch:

jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: 17
distribution: oracle
cache: maven
- name: Install dependencies
run: |
git clone --no-tags --depth 1 https://github.com/EaseCation/Network.git target/Network
cd target/Network
mvn -B clean install
- name: Publish package
run: mvn -B clean source:jar javadoc:jar deploy -P github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
12 changes: 12 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,18 @@
</build>

<profiles>
<profile>
<id>github</id>

<distributionManagement>
<repository>
<id>github</id>
<name>GitHub Packages</name>
<url>https://maven.pkg.github.com/EaseCation/Nukkit</url>
</repository>
</distributionManagement>
</profile>

<profile>
<id>java21</id>

Expand Down

0 comments on commit b11245e

Please sign in to comment.