Skip to content

πŸ’š specify git user #24

πŸ’š specify git user

πŸ’š specify git user #24

name: 'Build & Publish NPM package'
on:
push:
branches:
- '*'
permissions:
contents: 'read'
jobs:
publish:
runs-on: 'ubuntu-latest'
steps:
- name: 'Checkout Repository πŸ›ŽοΈ'
uses: 'actions/checkout@v4'
- name: 'Use Java'
uses: 'actions/setup-java@v4'
with:
distribution: 'temurin'
java-version: '17'
- name: 'Build πŸ—οΈ'
run: './scripts/generate.sh'
# - name: 'Setup πŸ›ŽοΈ'
# uses: 'dudeofawesome/actions/node-setup@v1'
- name: 'Use Node.js πŸ“—'
uses: 'actions/setup-node@v4'
with:
registry-url: 'https://registry.npmjs.org'
- name: 'Install node modules πŸ“₯'
uses: 'dudeofawesome/actions/npm-install@v1'
with:
package-dir-path: 'output'
- name: 'Publish to NPM πŸš€'
id: 'publish'
if: '${{ github.ref_name }} == ${{ github.event.repository.default_branch }}'
env:
NODE_AUTH_TOKEN: '${{ secrets.NPM_AUTH_TOKEN }}'
working-directory: 'output'
run: |-
npm publish --access public
echo "package_url=https://www.npmjs.com/package/$(jq --raw-output '.name' 'package.json')" >> "$GITHUB_OUTPUT"