Release @glasskit.ai/create v0.1.1 #3
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release | |
| env: | |
| UV_PYTHON: "3.12" | |
| on: | |
| push: | |
| tags: | |
| - "pypi-glasskit-ai-v*" | |
| - "npm-glasskit-ai-create-v*" | |
| concurrency: | |
| group: release-${{ github.ref }} | |
| cancel-in-progress: false | |
| jobs: | |
| release-pypi: | |
| name: Test, build, publish | |
| if: startsWith(github.ref_name, 'pypi-glasskit-ai-v') | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: pypi | |
| url: https://pypi.org/p/glasskit.ai | |
| permissions: | |
| contents: write | |
| id-token: write | |
| defaults: | |
| run: | |
| working-directory: cli | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v7 | |
| with: | |
| fetch-depth: 0 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0 | |
| with: | |
| enable-cache: true | |
| cache-dependency-glob: uv.lock | |
| working-directory: cli | |
| - name: Install Python | |
| run: uv python install 3.12 | |
| - name: Sync dependencies | |
| run: uv sync --locked --dev | |
| - name: Verify Python runtime | |
| run: uv run python -c "import sys; assert sys.version_info[:2] == (3, 12), sys.version" | |
| - name: Verify tag matches package version | |
| shell: bash | |
| run: | | |
| PACKAGE_VERSION="$(uv version --short)" | |
| TAG_VERSION="${GITHUB_REF_NAME#pypi-glasskit-ai-v}" | |
| if [[ "${PACKAGE_VERSION}" != "${TAG_VERSION}" ]]; then | |
| echo "::error::pyproject.toml version ${PACKAGE_VERSION} does not match tag ${TAG_VERSION}" | |
| exit 1 | |
| fi | |
| - name: Type check | |
| run: uv run ty check | |
| - name: Run tests | |
| run: uv run pytest | |
| - name: Lint | |
| run: uv run ruff check | |
| - name: Check formatting | |
| run: uv run ruff format --check | |
| - name: Smoke test CLI help | |
| run: | | |
| uv run glasskit --help | |
| uv run glasskit eval --help | |
| - name: Build distributions | |
| run: uv build --no-sources --clear | |
| - name: Smoke test wheel | |
| run: uv run --isolated --no-project --with dist/*.whl glasskit --help | |
| - name: Smoke test source distribution | |
| run: uv run --isolated --no-project --with dist/*.tar.gz glasskit --help | |
| - name: Publish to PyPI | |
| run: uv publish --trusted-publishing always | |
| - name: Create GitHub Release | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| RELEASE_TAG_PREFIX: pypi-glasskit-ai-v | |
| run: | | |
| VERSION="${GITHUB_REF_NAME#${RELEASE_TAG_PREFIX}}" | |
| PREVIOUS_TAG="$( | |
| git tag --list "${RELEASE_TAG_PREFIX}*" --sort=-v:refname \ | |
| | grep -Fxv "${GITHUB_REF_NAME}" \ | |
| | head -n 1 \ | |
| || true | |
| )" | |
| { | |
| echo "PyPI package: glasskit.ai" | |
| echo "Version: ${VERSION}" | |
| if [[ -n "${PREVIOUS_TAG}" ]]; then | |
| echo | |
| echo "CLI changes since ${PREVIOUS_TAG}:" | |
| git log --format='- %s (%h)' "${PREVIOUS_TAG}..${GITHUB_REF_NAME}" -- . > /tmp/cli-release-changes.txt | |
| if [[ -s /tmp/cli-release-changes.txt ]]; then | |
| cat /tmp/cli-release-changes.txt | |
| else | |
| echo "- No changes under cli/." | |
| fi | |
| else | |
| echo | |
| echo "Initial PyPI release for glasskit.ai." | |
| fi | |
| } > release-notes.md | |
| gh release create "${GITHUB_REF_NAME}" dist/* \ | |
| --repo "${GITHUB_REPOSITORY}" \ | |
| --verify-tag \ | |
| --title "PyPI: glasskit.ai v${VERSION}" \ | |
| --notes-file release-notes.md | |
| release-npm: | |
| name: Test, pack, publish | |
| if: startsWith(github.ref_name, 'npm-glasskit-ai-create-v') | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: npm | |
| url: https://www.npmjs.com/package/@glasskit.ai/create | |
| permissions: | |
| contents: write | |
| id-token: write | |
| defaults: | |
| run: | |
| working-directory: js | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v7 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Node | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: 24 | |
| registry-url: "https://registry.npmjs.org" | |
| package-manager-cache: false | |
| - name: Show versions | |
| run: | | |
| node --version | |
| npm --version | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Verify tag matches package version | |
| shell: bash | |
| run: | | |
| PACKAGE_VERSION="$(node -p "require('./package.json').version")" | |
| TAG_VERSION="${GITHUB_REF_NAME#npm-glasskit-ai-create-v}" | |
| if [[ "${PACKAGE_VERSION}" != "${TAG_VERSION}" ]]; then | |
| echo "::error::package.json version ${PACKAGE_VERSION} does not match tag ${TAG_VERSION}" | |
| exit 1 | |
| fi | |
| - name: Run tests | |
| run: npm test | |
| - name: Pack package | |
| shell: bash | |
| run: | | |
| mkdir -p /tmp/npm-package | |
| npm pack --pack-destination /tmp/npm-package | |
| ls -la /tmp/npm-package | |
| - name: Smoke test packed package | |
| shell: bash | |
| run: | | |
| TARBALL="$(ls /tmp/npm-package/*.tgz)" | |
| TMP="$(mktemp -d)" | |
| OUT="$(mktemp -d)" | |
| npm install --prefix "${TMP}" "${TARBALL}" | |
| "${TMP}/node_modules/.bin/create-glasskit" --help | |
| "${TMP}/node_modules/.bin/create-glasskit" --version | |
| ( | |
| cd "${OUT}" | |
| "${TMP}/node_modules/.bin/create-glasskit" | |
| ) | |
| test -f "${OUT}/rokid-starter/AGENTS.md" | |
| test -f "${OUT}/rokid-starter/.gitignore" | |
| test ! -e "${OUT}/rokid-starter/gitignore" | |
| test -f "${OUT}/rokid-starter/gradle/wrapper/gradle-wrapper.jar" | |
| - name: Publish to npm | |
| run: npm publish --access public | |
| - name: Create GitHub Release | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| RELEASE_TAG_PREFIX: npm-glasskit-ai-create-v | |
| run: | | |
| VERSION="${GITHUB_REF_NAME#${RELEASE_TAG_PREFIX}}" | |
| PREVIOUS_TAG="$( | |
| git tag --list "${RELEASE_TAG_PREFIX}*" --sort=-v:refname \ | |
| | grep -Fxv "${GITHUB_REF_NAME}" \ | |
| | head -n 1 \ | |
| || true | |
| )" | |
| { | |
| echo "npm package: @glasskit.ai/create" | |
| echo "Version: ${VERSION}" | |
| if [[ -n "${PREVIOUS_TAG}" ]]; then | |
| echo | |
| echo "JS create package changes since ${PREVIOUS_TAG}:" | |
| git log --format='- %s (%h)' "${PREVIOUS_TAG}..${GITHUB_REF_NAME}" -- . > /tmp/npm-release-changes.txt | |
| if [[ -s /tmp/npm-release-changes.txt ]]; then | |
| cat /tmp/npm-release-changes.txt | |
| else | |
| echo "- No changes under js/." | |
| fi | |
| else | |
| echo | |
| echo "Initial npm release for @glasskit.ai/create." | |
| fi | |
| } > release-notes.md | |
| gh release create "${GITHUB_REF_NAME}" /tmp/npm-package/*.tgz \ | |
| --repo "${GITHUB_REPOSITORY}" \ | |
| --verify-tag \ | |
| --title "npm: @glasskit.ai/create v${VERSION}" \ | |
| --notes-file release-notes.md |