Release CLI #8
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: Release CLI | |
permissions: | |
contents: write | |
packages: write | |
on: | |
workflow_dispatch: | |
inputs: | |
release_type: | |
description: "Release type: patch, minor, major" | |
required: true | |
default: patch | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: "22" | |
- name: Install dependencies | |
run: npm install | |
- name: Build the cli | |
run: npm run build | |
- name: Generate binaries | |
run: npm run binaries | |
- name: Login with git | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "Florian Bigot" | |
- name: Login to npm registry | |
run: npm set "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" | |
- name: Run release-it | |
run: npm run release -- --ci --${{ github.event.inputs.release_type }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |