Skip to content

Commit

Permalink
Update GitHub Packages configuration and workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
ZerroDevs committed Jan 21, 2025
1 parent 47bd3b8 commit 039ebab
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 11 deletions.
31 changes: 21 additions & 10 deletions .github/workflows/publish-package.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,33 @@
name: Node.js Package
name: Publish to GitHub Packages

on:
push:
branches: [ main ]
release:
types: [created]
workflow_dispatch:

jobs:
build:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 16
registry-url: https://npm.pkg.github.com/
node-version: '16.x'
registry-url: 'https://npm.pkg.github.com'
scope: '@zerrodevs'
- run: npm ci
- run: npm publish

- name: Install dependencies
run: npm install

- name: Build
run: npm run build --if-present

- name: Publish to GitHub Packages
run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"main": "src/index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "node examples/unified-bot.js"
"start": "node examples/unified-bot.js",
"build": "echo \"No build required\""
},
"keywords": [
"discord.js",
Expand Down Expand Up @@ -45,6 +46,7 @@
"LICENSE"
],
"publishConfig": {
"registry": "https://npm.pkg.github.com",
"access": "public"
}
}

0 comments on commit 039ebab

Please sign in to comment.