Release 1.4.3: admonition card wrap, tip green tint, inline code chrome. #50
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 | |
| on: | |
| push: | |
| tags: | |
| # Full semver only — rolling aliases (v1, v1.0) have fewer dots and are skipped. | |
| - "v*.*.*" | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: Semver X.Y.Z to publish (tag vX.Y.Z must exist on the remote) | |
| required: true | |
| permissions: | |
| contents: write | |
| id-token: write # npm trusted publishing (OIDC) — no NPM_TOKEN secret | |
| env: | |
| RELEASE_TAG: ${{ github.event_name == 'workflow_dispatch' && format('v{0}', inputs.version) || github.ref_name }} | |
| RELEASE_VERSION: ${{ github.event_name == 'workflow_dispatch' && inputs.version || github.ref_name }} | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| ref: ${{ env.RELEASE_TAG }} | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "24" | |
| cache: "pnpm" | |
| - name: Install dependencies | |
| run: pnpm install --no-frozen-lockfile | |
| - name: Verify package version matches tag | |
| run: | | |
| PACKAGE_VERSION=$(node -p "require('./package.json').version") | |
| TAG_VERSION="${RELEASE_VERSION#v}" | |
| if [ "$PACKAGE_VERSION" != "$TAG_VERSION" ]; then | |
| echo "Error: package.json version ($PACKAGE_VERSION) does not match tag version ($TAG_VERSION)" | |
| exit 1 | |
| fi | |
| - name: Generate changelog for release | |
| id: changelog | |
| run: | | |
| VERSION="${RELEASE_VERSION#v}" | |
| if [ -f "CHANGELOG.adoc" ]; then | |
| NOTES=$(awk -v v="$VERSION" ' | |
| $0 ~ "^== \\[" v "\\]" {flag=1; next} | |
| flag && /^== \[/ {exit} | |
| flag {print}' CHANGELOG.adoc) | |
| if [ -z "$NOTES" ]; then | |
| NOTES="Release v$VERSION" | |
| fi | |
| else | |
| NOTES="Release v$VERSION" | |
| fi | |
| echo "$NOTES" > release_notes.md | |
| - name: Build Antora UI Bundle | |
| run: | | |
| curl -L -o default-ui-bundle.zip https://gitlab.com/antora/antora-ui-default/-/jobs/artifacts/HEAD/raw/build/ui-bundle.zip?job=bundle-stable | |
| mkdir -p build/ui-bundle | |
| unzip default-ui-bundle.zip -d build/ui-bundle | |
| cp -r supplemental-ui/* build/ui-bundle/ | |
| cd build/ui-bundle | |
| zip -r ../../ui-bundle.zip . | |
| cd ../.. | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ env.RELEASE_TAG }} | |
| name: ${{ env.RELEASE_TAG }} | |
| body_path: release_notes.md | |
| files: ui-bundle.zip | |
| overwrite_files: true | |
| make_latest: true | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Setup Node.js for npm publish | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "24" | |
| registry-url: https://registry.npmjs.org | |
| - name: Publish to npm | |
| continue-on-error: true | |
| run: | | |
| pnpm ui-modules:sync | |
| pnpm ui-modules:validate | |
| node -e "const fs=require('fs');const p=JSON.parse(fs.readFileSync('package.json','utf8'));delete p.private;fs.writeFileSync('package.json',JSON.stringify(p,null,2)+'\n')" | |
| npm --version | |
| npm publish --access public | |
| npm deprecate antora-dark-theme@* "Split: use valentus-theme (chrome + dark) or antora-dark-mode (overlay only). See https://antora-supplemental.github.io/antora-dark-mode/antora-dark-mode/guide/legacy-names.html" || true | |
| # Trusted publisher on npmjs.com (package → Settings → Trusted publishing): | |
| # Provider: GitHub Actions | |
| # Organization/user: antora-supplemental | |
| # Repository: antora-dark-mode | |
| # Workflow filename: release.yml | |
| # Environment: (leave blank unless this job sets `environment:`) | |
| # Requires npm CLI ≥ 11.5.1 (Node 24 on ubuntu-latest). No NPM_TOKEN. | |
| - name: Resolve release commit | |
| id: rel | |
| run: echo "sha=$(git rev-list -n 1 "${RELEASE_TAG}")" >> "$GITHUB_OUTPUT" | |
| - name: Update rolling release lines | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| VERSION: ${{ env.RELEASE_VERSION }} | |
| RELEASE_SHA: ${{ steps.rel.outputs.sha }} | |
| GITHUB_REPOSITORY: ${{ github.repository }} | |
| run: node .github/scripts/post-release.mjs "${VERSION#v}" ui-bundle.zip | |
| - name: Commit supported-lines.json on main | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| cp supported-lines.json /tmp/supported-lines.json | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git fetch origin main | |
| git checkout main | |
| git pull origin main | |
| cp /tmp/supported-lines.json supported-lines.json | |
| git add supported-lines.json | |
| if git diff --staged --quiet; then | |
| echo "supported-lines.json unchanged" | |
| else | |
| git commit -m "chore: update supported-lines.json for ${RELEASE_TAG}" | |
| git push origin main | |
| fi |