Skip to content

📦 Publish › NPM Package #26

📦 Publish › NPM Package

📦 Publish › NPM Package #26

Workflow file for this run

name: "📦 Publish › NPM Package"
run-name: "📦 Publish › NPM Package"
on:
workflow_dispatch:
inputs:
# ---------------------------------------------------------------------------------------
# Name of the plugin to use when creating the release zip filename
# e.g: marked-alert-fa-v1.0.0.zip
# ---------------------------------------------------------------------------------------
PLUGIN_NAME:
description: "📦 Name of Plugin"
required: true
default: 'marked-alert-fa'
type: string
# ---------------------------------------------------------------------------------------
# ENABLE: the changelog generated in releases tab will only display single commits.
# DISABLE: the changelog shows pull requests completed based on their labels
# ---------------------------------------------------------------------------------------
CHANGELOG_MODE_COMMIT:
description: "📑 Use Commits Instead of PRs"
required: true
default: true
type: boolean
# ---------------------------------------------------------------------------------------
# ENABLE: Will show all types of commits, including uncategorized
# DISABLE: WIll only show actions that have been categorized using the format
# type(scope): description
# type: description
# ---------------------------------------------------------------------------------------
SHOW_UNCATEGORIZED:
description: "🗂️ Show Uncategorized Commits"
required: true
default: false
type: boolean
# ---------------------------------------------------------------------------------------
# ENABLE: released version will be marked as pre-release
# DISABLE: release version will be marked as stable / normal release
# ---------------------------------------------------------------------------------------
PRERELEASE:
description: "🧪 Build RC (Pre-release)"
required: true
default: false
type: boolean
# ---------------------------------------------------------------------------------------
# Release Candidate version number
# this will be added to the end of your released app in the releases page.
# e.g: marked-alert-fa-v1.0.0-rc.1
# ---------------------------------------------------------------------------------------
VERSION_RC:
description: "🧪 RC (Pre-release) Ver (marked-alert-fa-rc.v1)"
required: false
type: string
default: "1"
jobs:
# ---------------------------------------------------------------------------------------
# JOB > INITIALIZE
# ---------------------------------------------------------------------------------------
job-initialize:
name: >-
📦 Publish › Initialize
runs-on: ubuntu-latest
outputs:
package_version: ${{ steps.task_initialize_package_getversion.outputs.PACKAGE_VERSION }}
permissions:
contents: write
packages: write
steps:
- name: "✅ Start"
id: task_initialize_start
run: |
echo "Starting build"
# ---------------------------------------------------------------------------------------
# Job > Initialize > Checkout
# ---------------------------------------------------------------------------------------
- name: "☑️ Checkout"
id: task_initialize_checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
# ---------------------------------------------------------------------------------------
# JOB > PUBLISH > GITHUB PACKAGE
# ---------------------------------------------------------------------------------------
job-publish-gpr:
name: >-
📦 Package › Github
needs: job-initialize
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: "☑️ Checkout"
id: task_gpr_checkout
uses: actions/checkout@v4
- name: "⚙️ Setup Node"
id: task_gpr_node_setup
uses: actions/setup-node@v4
with:
node-version: '20.x'
registry-url: 'https://npm.pkg.github.com/'
scope: '@aetherinox'
- name: "🎚️ NPM › Install"
id: task_gpr_install
run: |
npm init -y --scope @aetherinox
npm install
- name: "📂 List Files"
id: task_gpr_publish_list
run: |
cat /home/runner/work/_temp/.npmrc
- name: "📦 Publish › Live"
id: task_gpr_publish_run_live
run: |
npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.SELF_TOKEN }}