publish #6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: publish | |
# Controls when the workflow will run | |
on: | |
push: | |
branches: [master] | |
workflow_dispatch: | |
jobs: | |
publish: | |
if: github.event_name == 'workflow_dispatch' | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/[email protected] | |
- name: Set up Node.js | |
uses: actions/[email protected] | |
with: | |
node-version: 20.x | |
- name: Install dependencies | |
run: npm install | |
- name: Build | |
run: npm run build | |
- name: Set up Git user | |
run: | | |
git config user.name "${{ github.actor }}" | |
git config user.email "${{ github.actor}}@users.noreply.github.com" | |
- name: "Setup npm" # Add our registry to npm config | |
run: | # Custom action | |
npm set "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" | |
- name: Run release-it | |
run: npx release-it --ci | |
env: | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |