Skip to content

1.0.0

1.0.0 #4

Workflow file for this run

name: πŸš€ Publish
on:
release:
types: [created]
jobs:
npm-publish:
name: Publish to NPM
runs-on: ubuntu-latest
steps:
- name: πŸ“š Checkout
uses: actions/checkout@v3
- name: 🟒 Node
uses: actions/setup-node@v3
with:
node-version: 18
registry-url: https://registry.npmjs.org/
- name: πŸ’½ Install
run: yarn install --frozen-lockfile
- name: πŸ› οΈ Build
run: yarn build
- name: πŸš€ Publish
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_AUTH_TOKEN}}
gpr-publish:
name: Publish to GitHub Package Registry
runs-on: ubuntu-latest
steps:
- name: πŸ“š Checkout
uses: actions/checkout@v3
- name: Store lowercase actor name
run: |
echo 'actor_name<<EOF' >> $GITHUB_ENV
echo ${{ github.actor }} | tr "A-Z" "a-z" >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
- name: Store package name
run: |
echo 'package_name<<EOF' >> $GITHUB_ENV
grep -Po '"name": *\K"[^"]*"' package.json | grep -oP '"\K[^"\047]+(?=["\047])' >> $GITHUB_ENV
echo 'EOF' >> $GITHUB_ENV
- name: 🟒 Node
uses: actions/setup-node@v3
with:
node-version: 18
registry-url: https://npm.pkg.github.com/
scope: '${{env.actor_name}}'
- name: πŸ’½ Install
run: yarn install --frozen-lockfile
- name: πŸ› οΈ Build
run: yarn build
- name: Update Package Name
run: |
sed -i 's,"name": "${{env.package_name}}","name": "@${{env.actor_name}}/${{env.package_name}}",' package.json
cat package.json
- name: πŸš€ Publish
run: npm publish --access public
env:
CI: true
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}