Skip to content

V3.29.0 Bridge 馃寜 #12

V3.29.0 Bridge 馃寜

V3.29.0 Bridge 馃寜 #12

Workflow file for this run

name: release
on:
release:
types: [published]
jobs:
upload-zip:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y jq ripgrep python3 python3-pip
- name: Install pytest for unit layer
run: python3 -m pip install --user --break-system-packages pytest
- name: Install shellcheck (pinned to keep CI behavior reproducible from local dev)
env:
SHELLCHECK_VERSION: v0.10.0
SHELLCHECK_SHA256: 6c881ab0698e4e6ea235245f22832860544f17ba386442fe7e9d629f8cbedf87
run: |
set -euo pipefail
tarball="shellcheck-${SHELLCHECK_VERSION}.linux.x86_64.tar.xz"
curl -fsSL -o "$tarball" \
"https://github.com/koalaman/shellcheck/releases/download/${SHELLCHECK_VERSION}/${tarball}"
echo "${SHELLCHECK_SHA256} ${tarball}" | sha256sum -c -
tar -xJf "$tarball"
sudo install -m 0755 "shellcheck-${SHELLCHECK_VERSION}/shellcheck" /usr/local/bin/shellcheck
rm -rf "shellcheck-${SHELLCHECK_VERSION}" "$tarball"
shellcheck --version
- name: Re-run full test suite against the tagged commit
run: make test
- run: make package
- name: Upload waza.zip to release
run: |
gh release upload "${{ github.event.release.tag_name }}" \
dist/waza.zip \
scripts/setup-rule.sh \
scripts/setup-statusline.sh \
--clobber
env:
GH_TOKEN: ${{ github.token }}
publish-npm:
runs-on: ubuntu-latest
needs: upload-zip
if: ${{ !github.event.release.prerelease && !github.event.release.draft }}
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 24
registry-url: https://registry.npmjs.org
package-manager-cache: false
- name: Verify release tag and Pi package metadata
run: |
set -euo pipefail
version="$(cat VERSION)"
test "${{ github.event.release.tag_name }}" = "v${version}"
test "$(node -p "require('./package.json').name")" = "@tw93/waza"
test "$(node -p "require('./package.json').version")" = "$version"
test "$(node -p "require('./package.json').pi.skills[0]")" = "./skills"
- name: Pack npm package
run: npm pack --dry-run --json
- name: Publish npm package
run: |
set -euo pipefail
version="$(cat VERSION)"
if npm view "@tw93/waza@${version}" version >/dev/null 2>&1; then
echo "@tw93/waza@${version} already published"
else
npm publish --access public
fi
- name: Verify npm package
run: |
set -euo pipefail
version="$(cat VERSION)"
for attempt in 1 2 3 4 5 6; do
published="$(npm view "@tw93/waza@${version}" version 2>/dev/null || true)"
latest="$(npm view @tw93/waza dist-tags.latest 2>/dev/null || true)"
if [ "$published" = "$version" ] && [ "$latest" = "$version" ]; then
echo "npm @tw93/waza@${version} is published and latest"
exit 0
fi
echo "waiting for npm @tw93/waza@${version}; published=${published:-missing} latest=${latest:-missing}"
sleep 10
done
echo "npm did not publish @tw93/waza@${version} as latest" >&2
exit 1