ci: verify published packages as consumers
This commit is contained in:
parent
c7f6b981f1
commit
daabd37c78
@ -83,7 +83,7 @@ jobs:
|
|||||||
echo "Queued packages:"
|
echo "Queued packages:"
|
||||||
cat /tmp/packages-to-publish.tsv || true
|
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:
|
env:
|
||||||
DRY_RUN: 'false'
|
DRY_RUN: 'false'
|
||||||
run: |
|
run: |
|
||||||
@ -106,6 +106,14 @@ jobs:
|
|||||||
(cd "$dir" && pnpm publish --no-git-checks --registry https://gitea.bytelyst.com/api/packages/bytelyst/npm/)
|
(cd "$dir" && pnpm publish --no-git-checks --registry https://gitea.bytelyst.com/api/packages/bytelyst/npm/)
|
||||||
rm -f "$dir/.npmrc"
|
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/
|
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
|
fi
|
||||||
done < /tmp/packages-to-publish.tsv
|
done < /tmp/packages-to-publish.tsv
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@bytelyst/errors",
|
"name": "@bytelyst/errors",
|
||||||
"version": "0.1.8",
|
"version": "0.1.9",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"exports": {
|
"exports": {
|
||||||
".": {
|
".": {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user