Skip to content

Merge pull request #12 from NxtLvLSoftware/dev-to-dist #13

Merge pull request #12 from NxtLvLSoftware/dev-to-dist

Merge pull request #12 from NxtLvLSoftware/dev-to-dist #13

name: Publish Package
on:
push:
branches: [dist]
tags:
- '*'
permissions:
contents: read
jobs:
publish:
name: Publish to npm registry
runs-on: ubuntu-latest
timeout-minutes: 5
env:
NODE_VERSION: 18
steps:
- name: Wait for CI success
if: github.event_name == 'push'
uses: lewagon/[email protected]
with:
ref: ${{ github.ref }}
check-name: Run tests (${{ env.NODE_VERSION }})
repo-token: ${{ secrets.GITHUB_TOKEN }}
wait-interval: 10
- name: Wait for example package CI success
if: github.event_name == 'push'
uses: lewagon/[email protected]
with:
ref: ${{ github.ref }}
check-name: Run example package tests (${{ env.NODE_VERSION }})
repo-token: ${{ secrets.GITHUB_TOKEN }}
wait-interval: 10
- name: Wait for example project CI success
if: github.event_name == 'push'
uses: lewagon/[email protected]
with:
ref: ${{ github.ref }}
check-name: Run example project tests (${{ env.NODE_VERSION }})
repo-token: ${{ secrets.GITHUB_TOKEN }}
wait-interval: 10
- uses: actions/checkout@v4
- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
registry-url: 'https://registry.npmjs.org'
- name: Export tag env var
run: |
echo "NPM_TAG=`echo '0.0.0-dist.${GITHUB_SHA::7}' >> $GITHUB_ENV
- name: Publish ${{ NPM_TAG }} to npm registry

Check failure on line 61 in .github/workflows/package-publish.yml

View workflow run for this annotation

GitHub Actions / Publish Package

Invalid workflow file

The workflow is not valid. .github/workflows/package-publish.yml (Line: 61, Col: 15): Unrecognized named-value: 'NPM_TAG'. Located at position 1 within expression: NPM_TAG .github/workflows/package-publish.yml (Line: 63, Col: 14): Unrecognized named-value: 'NPM_TAG'. Located at position 1 within expression: NPM_TAG
if: github.event_name == 'push'
run: |
npm publish --access public --tag ${{ NPM_TAG }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
- name: Publish ${{ github.ref_name }} to npm registry
if: github.event_name == 'tag'
run: |
npm publish --access public --tag ${{ github.ref_name }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}