Skip to content

Commit

Permalink
Added github workflow file.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tony Hales committed Dec 20, 2023
1 parent 90aa163 commit 623e172
Showing 1 changed file with 56 additions and 0 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/publish.yaml
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 }}

0 comments on commit 623e172

Please sign in to comment.