-
Notifications
You must be signed in to change notification settings - Fork 3
57 lines (46 loc) · 1.42 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
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 }}