Repository navigation
66 lines (62 loc) · 2.2 KB
/
Copy pathrelease.yml
File metadata and controls
66 lines (62 loc) · 2.2 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
name: Release
on:
release:
types: [published]
permissions:
contents: read
id-token: write
concurrency:
group: npm-release
cancel-in-progress: false
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: pnpm/action-setup@v6
- uses: actions/setup-node@v6
with:
node-version: 24
registry-url: https://registry.npmjs.org
package-manager-cache: false
- name: Use OIDC-capable npm
run: npm install --global npm@11.15.0
- run: pnpm install --frozen-lockfile
- run: pnpm check
- run: pnpm build
- name: Verify release version
id: version
env:
RELEASE_TAG: ${{ github.event.release.tag_name }}
run: |
core_version=$(node -p "require('./packages/core/package.json').version")
cli_version=$(node -p "require('./packages/cli/package.json').version")
test "$core_version" = "$cli_version"
test "$RELEASE_TAG" = "v$cli_version"
echo "value=$cli_version" >> "$GITHUB_OUTPUT"
- name: Check existing registry versions
id: registry
env:
VERSION: ${{ steps.version.outputs.value }}
run: |
if npm view "@bugbundle/core@$VERSION" version >/dev/null 2>&1; then
echo "core_exists=true" >> "$GITHUB_OUTPUT"
else
echo "core_exists=false" >> "$GITHUB_OUTPUT"
fi
if npm view "bugbundle@$VERSION" version >/dev/null 2>&1; then
echo "cli_exists=true" >> "$GITHUB_OUTPUT"
else
echo "cli_exists=false" >> "$GITHUB_OUTPUT"
fi
- name: Pack publishable artifacts
run: |
mkdir artifacts
pnpm --dir packages/core pack --pack-destination "$GITHUB_WORKSPACE/artifacts"
pnpm --dir packages/cli pack --pack-destination "$GITHUB_WORKSPACE/artifacts"
- name: Publish core
if: steps.registry.outputs.core_exists != 'true'
run: npm publish ./artifacts/bugbundle-core-*.tgz --access public
- name: Publish CLI
if: steps.registry.outputs.cli_exists != 'true'
run: npm publish ./artifacts/bugbundle-[0-9]*.tgz --access public