ci: verify published packages as consumers
This commit is contained in:
parent
c7f6b981f1
commit
daabd37c78
@ -83,7 +83,7 @@ jobs:
|
||||
echo "Queued packages:"
|
||||
cat /tmp/packages-to-publish.tsv || true
|
||||
|
||||
- name: Build, test, pack, and optionally publish queued packages
|
||||
- name: Build, test, pack, publish, and consumer-verify queued packages
|
||||
env:
|
||||
DRY_RUN: 'false'
|
||||
run: |
|
||||
@ -106,6 +106,14 @@ jobs:
|
||||
(cd "$dir" && pnpm publish --no-git-checks --registry https://gitea.bytelyst.com/api/packages/bytelyst/npm/)
|
||||
rm -f "$dir/.npmrc"
|
||||
npm view "$name@$version" version dist.shasum dist.tarball --userconfig /tmp/publish.npmrc --registry https://gitea.bytelyst.com/api/packages/bytelyst/npm/
|
||||
consumer_dir="/tmp/consumer-${name//@/}-${version}"
|
||||
consumer_dir="${consumer_dir//\//-}"
|
||||
rm -rf "$consumer_dir"
|
||||
mkdir -p "$consumer_dir"
|
||||
cp /tmp/publish.npmrc "$consumer_dir/.npmrc"
|
||||
printf '{"name":"publish-consumer-verify","private":true,"type":"module","dependencies":{"%s":"%s"}}\n' "$name" "$version" > "$consumer_dir/package.json"
|
||||
(cd "$consumer_dir" && pnpm install --no-frozen-lockfile)
|
||||
(cd "$consumer_dir" && node --input-type=module -e "const m=await import('$name'); console.log(Object.keys(m).sort().join(','));")
|
||||
fi
|
||||
done < /tmp/packages-to-publish.tsv
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@bytelyst/errors",
|
||||
"version": "0.1.8",
|
||||
"version": "0.1.9",
|
||||
"type": "module",
|
||||
"exports": {
|
||||
".": {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user