-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Tony Hales
committed
Dec 20, 2023
1 parent
90aa163
commit 623e172
Showing
1 changed file
with
56 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
name: Publish Package | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: [master] | ||
|
||
jobs: | ||
Build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Download Code | ||
uses: actions/checkout@v2 | ||
- name: Setup Environment | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: 19.x | ||
- name: Configure NPM | ||
run: npm config set //npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }} | ||
- name: Install Dependencies | ||
run: npm ci | ||
- name: Build | ||
run: npm run build --if-present | ||
- name: Perform Version Bump | ||
uses: "phips28/gh-action-bump-version@master" | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Pack | ||
run: npm pack | ||
- name: Upload | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: package | ||
path: "*.tgz" | ||
|
||
Publish: | ||
needs: [Build] | ||
runs-on: ubuntu-latest | ||
if: github.repository_owner == 'anupheaus' | ||
steps: | ||
- name: Download Package | ||
uses: actions/download-artifact@v2 | ||
with: | ||
name: package | ||
- name: Setup Environment | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: 19.x | ||
registry-url: https://npm.pkg.github.com/ | ||
scope: "@anupheaus" | ||
- name: Configure NPM | ||
run: echo "registry=https://npm.pkg.github.com/@anupheaus" >> .npmrc | ||
- name: Publish | ||
run: npm publish $(ls *.tgz) | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |