Skip to content

Publish package

Publish package #5

Workflow file for this run

name: Publish package

Check failure on line 1 in .github/workflows/publish.yaml

View workflow run for this annotation

GitHub Actions / .github/workflows/publish.yaml

Invalid workflow file

No steps defined in `steps` and no workflow called in `uses` for the following jobs: publish
on:
push:
tags:
- v*.*.*
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
publish-to-npm:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
registry-url: 'https://npm.pkg.github.com'
scope: ${{ github.repository_owner }}
- name: Update package.json
run: |
TAG_NAME=${GITHUB_REF/refs\/tags\//}
PACKAGE_VERSION=${TAG_NAME#v}
echo "Updating package.json to version $PACKAGE_VERSION"
cat <<< $(jq -r ".version=\"$PACKAGE_VERSION\"" package.json) > package.json
cat <<< $(jq -r ".name=\"@${{ github.repository }}\"" package.json) > package.json
cat package.json
# - name: Install dependencies
# run: yarn install --frozen-lockfile
# - name: Build
# run: yarn build
- name: Publish
run: yarn publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
publish-to-github:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
registry-url: 'https://npm.pkg.github.com'
scope: ${{ github.repository_owner }}
- name: Update package.json
run: |
TAG_NAME=${GITHUB_REF/refs\/tags\//}
PACKAGE_VERSION=${TAG_NAME#v}
echo "Updating package.json to version $PACKAGE_VERSION"
cat <<< $(jq -r ".version=\"$PACKAGE_VERSION\"" package.json) > package.json
cat <<< $(jq -r ".name=\"@${{ github.repository }}\"" package.json) > package.json
cat package.json
# - name: Install dependencies
# run: yarn install --frozen-lockfile
# - name: Build
# run: yarn build
- name: Publish
run: yarn publish
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}