Levitate: Update workflow to find type declaration via package.json (#53539)

* refactor(breaking-changes): make sure to pack and zip tarballed packages before artifact upload

* feat(check-breaking-changes): support extracting npm package tarballs before comparing packages

* chore(breaking-changes): fix typo preventing upload of pr_built_packages.zip
This commit is contained in:
Jack Westbrook 2022-08-11 15:17:51 +02:00 committed by GitHub
parent da72a4ed2e
commit b1ce721cf1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 8 deletions

View File

@ -34,8 +34,11 @@ jobs:
- name: Build packages
run: yarn packages:build
- name: Zip built packages
run: zip -r ./pr_built_packages.zip ./packages/**/dist
- name: Pack packages
run: yarn packages:pack --out ./%s.tgz
- name: Zip built tarballed packages
run: zip -r ./pr_built_packages.zip ./packages/**/*.tgz
- name: Upload build output as artifact
uses: actions/upload-artifact@v3
@ -75,8 +78,11 @@ jobs:
- name: Build packages
run: yarn packages:build
- name: Zip built packages
run: zip -r ./base_built_packages.zip ./packages/**/dist
- name: Pack packages
run: yarn packages:pack --out ./%s.tgz
- name: Zip built tarballed packages
run: zip -r ./base_built_packages.zip ./packages/**/*.tgz
- name: Upload build output as artifact
uses: actions/upload-artifact@v3
@ -105,10 +111,10 @@ jobs:
name: buildBase
- name: Unzip artifact from pr
run: unzip pr_built_packages.zip -d ./pr && rm pr_built_packages.zip
run: unzip -j pr_built_packages.zip -d ./pr && rm pr_built_packages.zip
- name: Unzip artifact from base
run: unzip base_built_packages.zip -d ./base && rm base_built_packages.zip
run: unzip -j base_built_packages.zip -d ./base && rm base_built_packages.zip
- name: Get link for the Github Action job
id: job

View File

@ -12,14 +12,20 @@ while IFS=" " read -r -a package; do
PACKAGE_PATH=$(basename "$package")
# Calculate current and previous package paths / names
PREV="./base/packages/$PACKAGE_PATH/dist/"
CURRENT="./pr/packages/$PACKAGE_PATH/dist/"
PREV="./base/$PACKAGE_PATH"
CURRENT="./pr/$PACKAGE_PATH"
# Temporarily skipping these packages as they don't have any exposed static typing
if [[ "$PACKAGE_PATH" == 'grafana-toolkit' || "$PACKAGE_PATH" == 'jaeger-ui-components' ]]; then
continue
fi
# Extract the npm package tarballs into separate directories e.g. ./base/@grafana-data.tgz -> ./base/grafana-data/
mkdir $PREV
tar -xf ./base/@$PACKAGE_PATH.tgz --strip-components=1 -C $PREV
mkdir $CURRENT
tar -xf ./pr/@$PACKAGE_PATH.tgz --strip-components=1 -C $CURRENT
# Run the comparison and record the exit code
echo ""
echo ""