-
-
Notifications
You must be signed in to change notification settings - Fork 5
94 lines (80 loc) · 3.03 KB
/
publish.yaml
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
name: Publish npm packages
on:
workflow_dispatch:
inputs:
release:
description: stable, canary, or release candidate?
required: true
type: choice
options:
- canary
- stable
- release-candidate
type:
description: 'Type of package to publish'
required: true
type: choice
options:
- patch
- minor
- major
jobs:
bump-version:
name: 'Bump Version'
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: 9.5.0
- name: Install Node.js
uses: actions/setup-node@v4
with:
registry-url: 'https://registry.npmjs.org/'
node-version: 20
- name: Install dependencies
run: pnpm install
- name: Build CLI
run: pnpm run build:scripts
- name: Build Projects
run: pnpm run build --filter=vitnode-backend --filter=vitnode-frontend
- name: Run script to bump version
run: pnpm run release
id: version-bump
env:
VERSION_TYPE: ${{ github.event.inputs.type }}
RELEASE_TYPE: ${{ github.event.inputs.release }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create Pre-release
if: github.event.inputs.release == 'canary' || github.event.inputs.release == 'release-candidate'
run: gh release create ${{ steps.version-bump.outputs.newTag }} --generate-notes --prerelease
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create Release
if: github.event.inputs.release == 'stable'
run: gh release create ${{ steps.version-bump.outputs.newTag }} --generate-notes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Publish canary
if: github.event.inputs.release == 'canary'
run: pnpm publish --access public --filter vitnode-backend --filter vitnode-frontend --filter create-vitnode-app --filter eslint-config-typescript-vitnode --tag canary --no-git-checks
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_CONFIG_PROVENANCE: true
- name: Publish release candidate
if: github.event.inputs.release == 'release-candidate'
run: pnpm publish --access public --filter vitnode-backend --filter vitnode-frontend --filter create-vitnode-app --filter eslint-config-typescript-vitnode --tag rc --no-git-checks
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_CONFIG_PROVENANCE: true
- name: Publish stable
if: github.event.inputs.release == 'stable'
run: pnpm publish --access public --filter vitnode-backend --filter vitnode-frontend --filter create-vitnode-app --filter eslint-config-typescript-vitnode --no-git-checks
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_CONFIG_PROVENANCE: true