Skip to content

Release CLI

Release CLI #29

Workflow file for this run

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: Generate token
id: generate_token
uses: tibdex/github-app-token@v1
with:
app_id: ${{ secrets.WORKFLOWS_GITHUB_APP_ID }}
private_key: ${{ secrets.WORKFLOWS_GITHUB_APP_PRIVATE_KEY }}
- name: Checkout code
uses: actions/checkout@v3
with:
token: ${{ steps.generate_token.outputs.token }}
- 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 "nanoapi.io"
- 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: ${{ steps.generate_token.outputs.token }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}