-
Notifications
You must be signed in to change notification settings - Fork 0
92 lines (86 loc) · 2.54 KB
/
Copy pathpublish.yml
File metadata and controls
92 lines (86 loc) · 2.54 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
83
84
85
86
87
88
89
90
91
92
name: Publish Package to npm
on:
push:
branches:
- main
pull_request:
branches:
- main
permissions: write-all
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false
jobs:
check:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v7
- uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- run: bun i
- run: bun lint
- run: bun run build
- run: bun lint
- run: bun test --coverage --coverage-reporter=lcov --coverage-reporter=text
- name: Upload to codecov.io
uses: codecov/codecov-action@v7
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
files: ./coverage/lcov.info
if: github.ref == 'refs/heads/main'
changepacks:
name: changepacks
runs-on: ubuntu-latest
permissions:
# create pull request comments
pull-requests: write
# Actions > General > Workflow permissions for creating pull request
# Create brench to create pull request
contents: write
id-token: write
needs:
- check
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
fetch-tags: true
- uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Install Node.js
uses: actions/setup-node@v7
with:
registry-url: "https://registry.npmjs.org"
node-version: 24
- run: bun i
- run: bun run build
- name: Verify publish tarballs
shell: bash
run: |
set -euo pipefail
for manifest in packages/*/package.json; do
package_dir="$(dirname "$manifest")"
pack_dir="$RUNNER_TEMP/publish-verify/${package_dir//\//-}"
mkdir -p "$pack_dir"
(cd "$package_dir" && bun pm pack --quiet --destination "$pack_dir")
tarballs=("$pack_dir"/*.tgz)
if [[ "${#tarballs[@]}" -ne 1 ]]; then
echo "Expected one tarball for $package_dir" >&2
exit 1
fi
packed_manifest="$(tar -xOf "${tarballs[0]}" package/package.json)"
if grep -q 'workspace:' <<< "$packed_manifest"; then
echo "Unresolved workspace dependency in $package_dir" >&2
exit 1
fi
done
- uses: changepacks/action@main
id: changepacks
with:
publish: true
outputs:
changepacks: ${{ steps.changepacks.outputs.changepacks }}