Skip to content

Update publishPackage.yml #16

Update publishPackage.yml

Update publishPackage.yml #16

name: Publish to GitHub Packages
on:
push:
branches:
- origin # Adjust the branch name as needed
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up JDK
uses: actions/setup-java@v2
with:
java-version: '17' # Adjust the Java version as needed
distribution: 'adopt' # Specify the distribution (e.g., 'adopt', 'adopt-openj9', 'adopt-hotspot')
- name: Build
run: |
./gradlew build
env:
GIT_TOKEN: ${{ secrets.GIT_TOKEN }} # Updated to use GIT_TOKEN
- name: Publish JAR to GitHub Packages
run: |
echo "Publishing JAR to GitHub Packages"
echo "registry=https://npm.pkg.github.com/Dueris" >> ~/.npmrc
echo "//npm.pkg.github.com/:_authToken=\${{ secrets.GIT_TOKEN }}" >> ~/.npmrc
GH_TOKEN=${{ github.token }} gh release upload v0.2.2 "build/libs/genesis-standalone-mc1.20-v0.2.2.jar" --clobber
env:
GIT_TOKEN: ${{ secrets.GIT_TOKEN }} # Updated to use GIT_TOKEN