Release 1.0.9: double horizontal rail padding for mast and nav tree #16
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: | |
| - "v*" | |
| permissions: | |
| contents: write | |
| id-token: write # Required for npm trusted publishing (OIDC) | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| environment: npm # Must match the environment configured in npm trusted publisher | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - 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 | |
| - name: Verify package version matches tag | |
| run: | | |
| PACKAGE_VERSION=$(node -p "require('./package.json').version") | |
| TAG_VERSION=${GITHUB_REF#refs/tags/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: Create tarball | |
| run: pnpm pack | |
| - name: Generate changelog for release | |
| id: changelog | |
| run: | | |
| # Extract version from tag | |
| VERSION=${GITHUB_REF#refs/tags/v} | |
| # Try to extract changelog section for this version, or use default message | |
| if [ -f "CHANGELOG.adoc" ]; then | |
| # Headings are "== [X.Y.Z] - date"; extract body until the next "== [" section | |
| 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 | |
| # Write to file to handle multiline | |
| echo "$NOTES" > release_notes.md | |
| - name: Build Antora UI Bundle | |
| run: | | |
| # Fetch the default UI bundle to use as a base | |
| 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 | |
| # Create a temporary directory to merge files | |
| mkdir -p build/ui-bundle | |
| unzip default-ui-bundle.zip -d build/ui-bundle | |
| cp -r supplemental-ui/* build/ui-bundle/ | |
| # Create the new bundle | |
| cd build/ui-bundle | |
| zip -r ../../ui-bundle.zip . | |
| cd ../.. | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| body_path: release_notes.md | |
| files: | | |
| antora-dark-theme-*.tgz | |
| ui-bundle.zip | |
| generate_release_notes: true | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Publish to npm (trusted publishing) | |
| if: ${{ !contains(github.ref, '-') }} | |
| run: | | |
| rm -f *.tgz | |
| npm publish --access public --provenance |