forked from nuxt-modules/mcp-toolkit
-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (59 loc) · 1.79 KB
/
release.yml
File metadata and controls
71 lines (59 loc) · 1.79 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
name: release
on:
push:
branches:
- main
workflow_dispatch:
concurrency: ${{ github.workflow }}-${{ github.ref }}
permissions: {}
jobs:
release:
permissions:
contents: write
pull-requests: write
id-token: write
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- run: corepack enable
- uses: actions/setup-node@v6
with:
node-version: latest
registry-url: https://registry.npmjs.org
- name: Install dependencies
run: pnpm install
- name: Prepare
run: pnpm dev:prepare
- name: Build module
run: pnpm build:module
- name: Create Release PR or Publish
id: changesets
uses: changesets/action@v1
with:
title: "chore(repo): version packages"
version: pnpm run version
publish: pnpm run release
createGithubReleases: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_CONFIG_PROVENANCE: true
- name: Push tags
if: steps.changesets.outputs.published == 'true'
run: git push --tags
- name: Create GitHub Releases
if: steps.changesets.outputs.published == 'true'
run: |
for pkg in $(echo '${{ steps.changesets.outputs.publishedPackages }}' | jq -r '.[] | .name + "@" + .version'); do
tag="$pkg"
if gh release view "$tag" > /dev/null 2>&1; then
echo "Release $tag already exists, skipping"
else
gh release create "$tag" --draft --generate-notes --title "$tag"
fi
done
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}