Skip to content

Add Publish Steps for Scripting Library Packages (#8) #10

Add Publish Steps for Scripting Library Packages (#8)

Add Publish Steps for Scripting Library Packages (#8) #10

name: Release Changes
on:
push:
branches:
- main
jobs:
build:
environment: release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Use Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 20
- run: npm ci
- run: npm run test # Fully build the repo so we have artifacts available to create releases, include tests so we don't ship in a broken state
# Uncomment the below when ready to publish to NPM for the first time
- name: Set git credentials
run: |
git config --global user.name "Raphael Landaverde"
git config --global user.email "[email protected]"
git remote set-url origin "https://[email protected]/mojang/minecraft-scripting-libraries"
env:
REPO_PAT: ${{ secrets.REPO_PAT }}
# Pass the token on the command line for publishing
- name: Publish
run: npm run release -- --token "$NPM_TOKEN" --yes --new
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Publish Releases
uses: ncipollo/release-action@v1
with:
artifacts: "dist/**/*"
token: ${{ secrets.REPO_PAT }}
prerelease: false
draft: false
releaseName: ${{ github.event.head_commit.message }}
releaseNotes: ${{ github.event.head_commit.message }}
releaseNotesFile: "CHANGELOG.md"
tag: ${{ github.ref }}
overwrite: true