-
Notifications
You must be signed in to change notification settings - Fork 0
82 lines (67 loc) · 2.15 KB
/
Copy pathrelease.yml
File metadata and controls
82 lines (67 loc) · 2.15 KB
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
name: Release (bump version, tag, publish)
on:
workflow_dispatch:
inputs:
bump:
description: Version bump (patch/minor/major)
required: true
default: patch
type: choice
options:
- patch
- minor
- major
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 24
registry-url: https://npm.pkg.github.com
- name: Install dependencies
run: npm install
- name: Run tests
run: npm test
- name: Configure git identity
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- name: Bump version and create tag
run: |
npm version "${{ inputs.bump }}" -m "chore(release): %s"
- name: Read new tag
id: tag
run: |
VERSION=$(node -p "require('./package.json').version")
echo "name=v$VERSION" >> "$GITHUB_OUTPUT"
- name: Push commit and tags
run: git push --follow-tags
- name: Build CLI (create dist/)
run: npm run build
env:
ENSEMBLE_FIREBASE_API_KEY: ${{ secrets.ENSEMBLE_FIREBASE_API_KEY }}
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.tag.outputs.name }}
generate_release_notes: true
- name: Publish to GitHub Packages
run: npm publish --registry=https://npm.pkg.github.com
env:
NODE_AUTH_TOKEN: ${{ secrets.GH_PACKAGES_TOKEN != '' && secrets.GH_PACKAGES_TOKEN || github.token }}
- name: Publish to npm (trusted publishing / OIDC)
run: |
node --version
npm --version
npm config set @ensembleui:registry https://registry.npmjs.org
npm publish --registry=https://registry.npmjs.org --provenance