44 lines
1.2 KiB
YAML
44 lines
1.2 KiB
YAML
name: Build NPM Package
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
- release/**
|
|
pull_request:
|
|
branches:
|
|
- master
|
|
- release/**
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
package:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: "Checkout"
|
|
uses: https://github.com/actions/checkout@v3
|
|
- name: "Build and test the project."
|
|
uses: act/common/npm/npm-test@master
|
|
with:
|
|
workingDirectory: .
|
|
uploadArtifacts: "false"
|
|
- name: "Pack the next version of the NPM package."
|
|
id: get_version
|
|
uses: act/common/npm/npm-pack-and-compare@master
|
|
with:
|
|
name: your-package-name
|
|
workingDirectory: .
|
|
authToken: ${{ secrets.ACTIONS_TOKEN }}
|
|
skipCompare: "true"
|
|
- name: "Upload Artifacts."
|
|
uses: https://github.com/actions/upload-artifact@v3
|
|
with:
|
|
name: ${{ steps.get_version.outputs.tgzName }}
|
|
path: ${{ steps.get_version.outputs.tgz }}
|
|
- name: "Upload the NPM package."
|
|
if: ${{ steps.get_version.outputs.hasChanged }}
|
|
uses: act/common/npm/npm-push@master
|
|
with:
|
|
tgz: ${{ steps.get_version.outputs.tgz }}
|
|
apiKey: ${{ secrets.ACTIONS_TOKEN }}
|