chore(release): bump version to v0.1.25 #428
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: | |
| # Only match semver tags like v0.0.191, not major version tags like v0 | |
| - 'v[0-9]*.[0-9]*.[0-9]*' | |
| # Manual trigger for testing and recovery scenarios | |
| workflow_dispatch: | |
| inputs: | |
| dry_run: | |
| description: 'Dry run mode (skip actual publishing)' | |
| required: false | |
| default: true | |
| type: boolean | |
| skip_crates_io: | |
| description: 'Skip publishing to crates.io (if already published)' | |
| required: false | |
| default: false | |
| type: boolean | |
| skip_pypi: | |
| description: 'Skip publishing to PyPI (if already published)' | |
| required: false | |
| default: false | |
| type: boolean | |
| skip_npm: | |
| description: 'Skip publishing to npm (if already published)' | |
| required: false | |
| default: false | |
| type: boolean | |
| permissions: | |
| contents: write | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| jobs: | |
| test: | |
| name: Run tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| # Toolchain setup | |
| - uses: jdx/mise-action@v2 | |
| with: | |
| experimental: true | |
| install: true | |
| - name: Install mise tools | |
| run: mise install --yes | |
| - name: Run tests | |
| run: | | |
| # Use fast CI-optimized tests | |
| if command -v cargo-nextest >/dev/null 2>&1; then | |
| make test-ci | |
| else | |
| make test | |
| fi | |
| build: | |
| name: Build ${{ matrix.target }} | |
| needs: test | |
| strategy: | |
| matrix: | |
| include: | |
| # Linux glibc targets (manylinux wheels for standard Linux) | |
| - os: ubuntu-latest | |
| target: x86_64-unknown-linux-gnu | |
| # Set jemalloc page size explicitly for zig cross-compilation | |
| jemalloc_page_size: '12' | |
| - os: ubuntu-latest | |
| target: aarch64-unknown-linux-gnu | |
| # Configure jemalloc for 64K pages to support 16K page systems (Asahi Linux, RPi5) | |
| # See: https://github.com/rvben/rumdl/issues/256 | |
| jemalloc_page_size: '16' | |
| # Linux musl targets (static binaries for Alpine Linux) | |
| - os: ubuntu-latest | |
| target: x86_64-unknown-linux-musl | |
| # Set jemalloc page size explicitly for zig cross-compilation | |
| jemalloc_page_size: '12' | |
| - os: ubuntu-latest | |
| target: aarch64-unknown-linux-musl | |
| jemalloc_page_size: '16' | |
| # Windows and macOS targets | |
| - os: windows-latest | |
| target: x86_64-pc-windows-msvc | |
| - os: macos-latest | |
| target: x86_64-apple-darwin | |
| # Set jemalloc page size explicitly | |
| jemalloc_page_size: '12' | |
| - os: macos-latest | |
| target: aarch64-apple-darwin | |
| # Apple Silicon uses 16K pages | |
| jemalloc_page_size: '14' | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| # Toolchain setup (mise installs rust, python, maturin, etc.) | |
| - uses: jdx/mise-action@v2 | |
| with: | |
| version: 2025.8.18 | |
| experimental: false # Use stable releases only | |
| install: true | |
| # Ensure all mise tools are installed (including zig for Linux) | |
| - name: Install mise tools | |
| run: mise install --yes | |
| # Verify zig installation on Linux only | |
| - name: Verify zig installation | |
| if: matrix.os == 'ubuntu-latest' | |
| run: mise exec zig -- zig version || echo "Zig verification failed" | |
| # Install rust target for cross-compilation | |
| - name: Install Rust target | |
| run: rustup target add ${{ matrix.target }} | |
| # Build wheel | |
| - name: Build wheel | |
| env: | |
| # Set jemalloc page size for aarch64-linux to support 16K page systems | |
| JEMALLOC_SYS_WITH_LG_PAGE: ${{ matrix.jemalloc_page_size }} | |
| run: | | |
| case "${{ matrix.target }}" in | |
| *-musl) | |
| # Use musllinux_1_2 with zig for static Linux binaries (Alpine) | |
| mise exec -- maturin build --release --target ${{ matrix.target }} --compatibility musllinux_1_2 --zig | |
| ;; | |
| *-gnu) | |
| # Use manylinux_2_28 for standard glibc Linux distributions | |
| # (manylinux2014 doesn't support newer glibc symbols like __cxa_thread_atexit_impl) | |
| mise exec -- maturin build --release --target ${{ matrix.target }} --compatibility manylinux_2_28 --zig | |
| ;; | |
| *) | |
| # Native compilation for Windows and macOS | |
| mise exec -- maturin build --release --target ${{ matrix.target }} | |
| ;; | |
| esac | |
| shell: bash | |
| # Build binary | |
| - name: Build binary | |
| env: | |
| # Set jemalloc page size for aarch64-linux to support 16K page systems | |
| JEMALLOC_SYS_WITH_LG_PAGE: ${{ matrix.jemalloc_page_size }} | |
| run: | | |
| case "${{ matrix.target }}" in | |
| *-linux-*) | |
| # Use cargo-zigbuild for all Linux builds (both musl and gnu) | |
| cargo install cargo-zigbuild --locked | |
| mise exec -- cargo zigbuild --release --target ${{ matrix.target }} --bin rumdl | |
| ;; | |
| *) | |
| # Native compilation for Windows and macOS | |
| cargo build --release --target ${{ matrix.target }} --bin rumdl | |
| ;; | |
| esac | |
| shell: bash | |
| # Smoketest: verify binary runs (skip cross-compiled aarch64-linux) | |
| - name: Verify binary | |
| if: ${{ !contains(matrix.target, 'aarch64-unknown-linux') }} | |
| run: | | |
| if [[ "${{ runner.os }}" == "Windows" ]]; then | |
| ./target/${{ matrix.target }}/release/rumdl.exe --version | |
| else | |
| ./target/${{ matrix.target }}/release/rumdl --version | |
| fi | |
| shell: bash | |
| # Create release archives | |
| - name: Create release archives | |
| run: | | |
| # Extract version from ref (e.g., refs/tags/v0.0.97 -> v0.0.97) | |
| VERSION=${GITHUB_REF#refs/tags/} | |
| # Create directory structure for archive | |
| mkdir -p release-package | |
| if [[ "${{ runner.os }}" == "Windows" ]]; then | |
| # Windows: Create a zip archive | |
| cp "target/${{ matrix.target }}/release/rumdl.exe" release-package/rumdl.exe | |
| # Create zip archive (using PowerShell via bash) | |
| cd release-package | |
| powershell -command "Compress-Archive -Path rumdl.exe -DestinationPath ../rumdl-${VERSION}-${{ matrix.target }}.zip" | |
| cd .. | |
| # Calculate SHA256 for zip | |
| powershell -command "Get-FileHash -Path 'rumdl-${VERSION}-${{ matrix.target }}.zip' -Algorithm SHA256 | Select-Object -ExpandProperty Hash" > "rumdl-${VERSION}-${{ matrix.target }}.zip.sha256" | |
| else | |
| # Unix: Create tar.gz archive | |
| cp "target/${{ matrix.target }}/release/rumdl" release-package/rumdl | |
| # Create tar.gz archive | |
| tar -czf "rumdl-${VERSION}-${{ matrix.target }}.tar.gz" -C release-package rumdl | |
| # Calculate SHA256 | |
| if [[ "${{ runner.os }}" == "macOS" ]]; then | |
| shasum -a 256 "rumdl-${VERSION}-${{ matrix.target }}.tar.gz" > "rumdl-${VERSION}-${{ matrix.target }}.tar.gz.sha256" | |
| else | |
| sha256sum "rumdl-${VERSION}-${{ matrix.target }}.tar.gz" > "rumdl-${VERSION}-${{ matrix.target }}.tar.gz.sha256" | |
| fi | |
| fi | |
| # Clean up | |
| rm -rf release-package | |
| shell: bash | |
| # Upload artifacts | |
| - name: Upload wheel | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| path: target/wheels/* | |
| name: wheel-${{ matrix.target }} | |
| - name: Upload release archives | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| path: | | |
| rumdl-*-${{ matrix.target }}.tar.gz* | |
| rumdl-*-${{ matrix.target }}.zip* | |
| name: release-${{ matrix.target }} | |
| sdist: | |
| runs-on: ubuntu-latest | |
| needs: test | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: jdx/mise-action@v2 | |
| with: | |
| experimental: true | |
| install: true | |
| - name: Install mise tools | |
| run: mise install --yes | |
| - name: Build source distribution | |
| run: mise exec -- maturin sdist | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| path: target/wheels/*.tar.gz | |
| name: sdist | |
| build-wasm: | |
| name: Build WASM | |
| needs: test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Setup Rust | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| targets: wasm32-unknown-unknown | |
| - name: Install wasm-pack | |
| uses: taiki-e/install-action@wasm-pack | |
| - name: Build WASM | |
| run: wasm-pack build --target web --no-default-features --features wasm | |
| - name: Prepare package | |
| run: | | |
| cp wasm-pkg/README.md pkg/ | |
| cp LICENSE pkg/ | |
| jq -s '.[0] * .[1]' pkg/package.json wasm-pkg/package.json.tmpl > pkg/package.json.new | |
| mv pkg/package.json.new pkg/package.json | |
| - name: Upload WASM artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: wasm-pkg | |
| path: pkg/ | |
| test-python-package: | |
| name: Test Python Package (${{ matrix.os }}) | |
| needs: build | |
| strategy: | |
| matrix: | |
| include: | |
| - os: ubuntu-latest | |
| wheel-path: "*wheel-x86_64-unknown-linux-gnu/*.whl" | |
| - os: macos-latest | |
| wheel-path: "*wheel-aarch64-apple-darwin/*.whl" | |
| - os: windows-latest | |
| wheel-path: "*wheel-x86_64-pc-windows-*/*.whl" | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v5 | |
| with: | |
| enable-cache: false | |
| - name: Download wheel artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| pattern: wheel-* | |
| path: wheels | |
| - name: Find and install wheel | |
| shell: bash | |
| run: | | |
| # Find the appropriate wheel by matching the artifact directory path | |
| WHEEL=$(find wheels -path "${{ matrix.wheel-path }}" -type f | head -1) | |
| if [ -z "$WHEEL" ]; then | |
| echo "ERROR: No wheel found matching path pattern ${{ matrix.wheel-path }}" | |
| echo "Available wheels:" | |
| find wheels -name "*.whl" -type f | |
| exit 1 | |
| fi | |
| echo "Installing wheel: $WHEEL" | |
| # Create and use a virtual environment | |
| uv venv .venv | |
| uv pip install --python .venv "$WHEEL" | |
| - name: Test Python import and version | |
| shell: bash | |
| run: | | |
| if [[ "${{ runner.os }}" == "Windows" ]]; then | |
| source .venv/Scripts/activate | |
| else | |
| source .venv/bin/activate | |
| fi | |
| python -c "import rumdl; print(f'Imported rumdl {rumdl.__version__}')" | |
| - name: Verify version matches Cargo.toml | |
| shell: bash | |
| run: | | |
| if [[ "${{ runner.os }}" == "Windows" ]]; then | |
| source .venv/Scripts/activate | |
| else | |
| source .venv/bin/activate | |
| fi | |
| CARGO_VERSION=$(grep '^version =' Cargo.toml | head -1 | sed 's/.*"\(.*\)".*/\1/') | |
| PYTHON_VERSION=$(python -c "import rumdl; print(rumdl.__version__)") | |
| if [ "$CARGO_VERSION" != "$PYTHON_VERSION" ]; then | |
| echo "❌ ERROR: Version mismatch! Cargo.toml=$CARGO_VERSION, Python=$PYTHON_VERSION" | |
| exit 1 | |
| fi | |
| echo "✅ Versions match: $CARGO_VERSION" | |
| - name: Test rumdl binary works | |
| shell: bash | |
| run: | | |
| if [[ "${{ runner.os }}" == "Windows" ]]; then | |
| source .venv/Scripts/activate | |
| else | |
| source .venv/bin/activate | |
| fi | |
| echo "# Test" > test.md | |
| rumdl --version | |
| rumdl check test.md | |
| echo "✅ Binary works correctly" | |
| build-npm-cli: | |
| name: Build npm CLI packages | |
| needs: [build] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| registry-url: 'https://registry.npmjs.org' | |
| - name: Download release archives | |
| uses: actions/download-artifact@v4 | |
| with: | |
| pattern: release-* | |
| path: archives | |
| - name: Prepare npm packages | |
| run: | | |
| # Extract version from ref (e.g., refs/tags/v0.0.97 -> 0.0.97) | |
| VERSION=${GITHUB_REF#refs/tags/v} | |
| echo "Version: $VERSION" | |
| # Update versions in all package.json files | |
| for pkg in npm/cli-*/package.json npm/rumdl/package.json; do | |
| jq --arg v "$VERSION" '.version = $v' "$pkg" > tmp.json && mv tmp.json "$pkg" | |
| done | |
| # Update optionalDependencies in main package | |
| jq --arg v "$VERSION" '.optionalDependencies |= with_entries(.value = $v)' \ | |
| npm/rumdl/package.json > tmp.json && mv tmp.json npm/rumdl/package.json | |
| # Extract binaries to platform packages | |
| # macOS | |
| tar -xzf archives/release-x86_64-apple-darwin/rumdl-*.tar.gz -C npm/cli-darwin-x64/ | |
| tar -xzf archives/release-aarch64-apple-darwin/rumdl-*.tar.gz -C npm/cli-darwin-arm64/ | |
| # Linux glibc | |
| tar -xzf archives/release-x86_64-unknown-linux-gnu/rumdl-*.tar.gz -C npm/cli-linux-x64/ | |
| tar -xzf archives/release-aarch64-unknown-linux-gnu/rumdl-*.tar.gz -C npm/cli-linux-arm64/ | |
| # Linux musl | |
| tar -xzf archives/release-x86_64-unknown-linux-musl/rumdl-*.tar.gz -C npm/cli-linux-x64-musl/ | |
| tar -xzf archives/release-aarch64-unknown-linux-musl/rumdl-*.tar.gz -C npm/cli-linux-arm64-musl/ | |
| # Windows | |
| unzip -o archives/release-x86_64-pc-windows-msvc/rumdl-*.zip -d npm/cli-win32-x64/ | |
| # Make binaries executable (artifacts don't preserve permissions) | |
| chmod +x npm/cli-darwin-x64/rumdl | |
| chmod +x npm/cli-darwin-arm64/rumdl | |
| chmod +x npm/cli-linux-x64/rumdl | |
| chmod +x npm/cli-linux-arm64/rumdl | |
| chmod +x npm/cli-linux-x64-musl/rumdl | |
| chmod +x npm/cli-linux-arm64-musl/rumdl | |
| # List package contents for verification | |
| echo "Package contents:" | |
| for dir in npm/cli-*/; do | |
| echo " $dir:" | |
| ls -la "$dir" | |
| done | |
| - name: Upload npm packages artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: npm-cli-packages | |
| path: npm/ | |
| test-npm-cli: | |
| name: Test npm CLI (${{ matrix.os }}) | |
| needs: build-npm-cli | |
| strategy: | |
| matrix: | |
| include: | |
| - os: ubuntu-latest | |
| platform-pkg: cli-linux-x64 | |
| - os: macos-latest | |
| platform-pkg: cli-darwin-arm64 | |
| - os: macos-15-intel | |
| platform-pkg: cli-darwin-x64 | |
| - os: windows-latest | |
| platform-pkg: cli-win32-x64 | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Download npm packages | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: npm-cli-packages | |
| path: npm | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Make binary executable | |
| if: runner.os != 'Windows' | |
| shell: bash | |
| run: chmod +x npm/${{ matrix.platform-pkg }}/rumdl | |
| - name: Install packages locally | |
| shell: bash | |
| run: | | |
| # Create test directory | |
| mkdir test-install | |
| cd test-install | |
| # Initialize package.json | |
| npm init -y | |
| # Install platform package first (local file) | |
| npm install ../npm/${{ matrix.platform-pkg }} | |
| # Install main package (local file) | |
| npm install ../npm/rumdl | |
| - name: Test rumdl binary | |
| shell: bash | |
| run: | | |
| cd test-install | |
| echo "# Test Heading" > test.md | |
| echo "" >> test.md | |
| echo "This is a test." >> test.md | |
| # Test version | |
| npx rumdl --version | |
| # Test linting | |
| npx rumdl check test.md | |
| echo "✅ npm CLI package works correctly" | |
| test-npm-cli-musl: | |
| name: Test npm CLI (linux-musl) | |
| needs: build-npm-cli | |
| runs-on: ubuntu-latest | |
| container: node:20-alpine | |
| steps: | |
| - name: Download npm packages | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: npm-cli-packages | |
| path: npm | |
| - name: Make binary executable | |
| shell: sh | |
| run: chmod +x npm/cli-linux-x64-musl/rumdl | |
| - name: Install packages locally | |
| shell: sh | |
| run: | | |
| mkdir test-install | |
| cd test-install | |
| npm init -y | |
| npm install ../npm/cli-linux-x64-musl | |
| npm install ../npm/rumdl | |
| - name: Test rumdl binary | |
| shell: sh | |
| run: | | |
| cd test-install | |
| printf '# Test Heading\n\nThis is a test.\n' > test.md | |
| npx rumdl --version | |
| npx rumdl check test.md | |
| echo "✅ npm CLI package works correctly" | |
| release: | |
| runs-on: ubuntu-latest | |
| needs: [build, sdist, test-python-package, build-wasm, test-npm-cli, test-npm-cli-musl] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: jdx/mise-action@v2 | |
| with: | |
| experimental: true | |
| - name: Publish to crates.io | |
| if: ${{ inputs.dry_run != true && inputs.skip_crates_io != true }} | |
| env: | |
| CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} | |
| run: cargo publish --locked | |
| - name: Test crates.io publish (dry run) | |
| if: ${{ inputs.dry_run == true && inputs.skip_crates_io != true }} | |
| run: | | |
| echo "DRY RUN: Would publish to crates.io" | |
| cargo publish --dry-run --locked | |
| - name: Skip crates.io publishing | |
| if: ${{ inputs.skip_crates_io == true }} | |
| run: echo "⏭️ Skipping crates.io publishing as requested" | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: artifacts | |
| - name: Publish to PyPI | |
| if: ${{ inputs.dry_run != true && inputs.skip_pypi != true }} | |
| env: | |
| TWINE_USERNAME: __token__ | |
| TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} | |
| run: | | |
| # Upload only Python packages (wheels and sdist), not Homebrew archives | |
| uv tool run twine upload artifacts/wheel-*/*.whl artifacts/sdist/*.tar.gz | |
| - name: Test PyPI upload (dry run) | |
| if: ${{ inputs.dry_run == true && inputs.skip_pypi != true }} | |
| run: | | |
| echo "DRY RUN: Would upload to PyPI:" | |
| find artifacts/wheel-* -name "*.whl" -type f | sort | |
| find artifacts/sdist -name "*.tar.gz" -type f | sort | |
| echo "" | |
| echo "Checking packages:" | |
| uv tool run twine check artifacts/wheel-*/*.whl artifacts/sdist/*.tar.gz | |
| - name: Skip PyPI publishing | |
| if: ${{ inputs.skip_pypi == true }} | |
| run: echo "⏭️ Skipping PyPI publishing as requested" | |
| - name: Download WASM artifact | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: wasm-pkg | |
| path: wasm-pkg | |
| - name: Setup Node.js | |
| if: ${{ inputs.skip_npm != true }} | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| registry-url: 'https://registry.npmjs.org' | |
| - name: Publish WASM to npm | |
| if: ${{ inputs.dry_run != true && inputs.skip_npm != true }} | |
| run: | | |
| cd wasm-pkg | |
| npm publish --access public | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| - name: Test WASM npm publish (dry run) | |
| if: ${{ inputs.dry_run == true && inputs.skip_npm != true }} | |
| run: | | |
| echo "DRY RUN: Would publish WASM to npm:" | |
| jq '{name, version}' wasm-pkg/package.json | |
| - name: Download npm CLI packages | |
| if: ${{ inputs.skip_npm != true }} | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: npm-cli-packages | |
| path: npm-cli | |
| - name: Publish CLI platform packages to npm | |
| if: ${{ inputs.dry_run != true && inputs.skip_npm != true }} | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| run: | | |
| # Publish platform packages first (they're dependencies of the main package) | |
| for pkg in npm-cli/cli-*/; do | |
| echo "Publishing $(basename "$pkg")..." | |
| cd "$pkg" | |
| npm publish --access public | |
| cd ../.. | |
| done | |
| - name: Publish CLI main package to npm | |
| if: ${{ inputs.dry_run != true && inputs.skip_npm != true }} | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| run: | | |
| cd npm-cli/rumdl | |
| npm publish --access public | |
| - name: Test CLI npm publish (dry run) | |
| if: ${{ inputs.dry_run == true && inputs.skip_npm != true }} | |
| run: | | |
| echo "DRY RUN: Would publish CLI packages to npm:" | |
| for pkg in npm-cli/cli-*/package.json npm-cli/rumdl/package.json; do | |
| echo " - $(jq -r '.name + "@" + .version' "$pkg")" | |
| done | |
| - name: Skip npm publishing | |
| if: ${{ inputs.skip_npm == true }} | |
| run: echo "⏭️ Skipping npm publishing as requested" | |
| - name: Notify obsidian-rumdl | |
| if: ${{ success() && inputs.dry_run != true && inputs.skip_npm != true }} | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.OBSIDIAN_DISPATCH_TOKEN }} | |
| run: | | |
| TAG_NAME=${GITHUB_REF#refs/tags/} | |
| VERSION=${TAG_NAME#v} | |
| curl -X POST \ | |
| -H "Accept: application/vnd.github+json" \ | |
| -H "Authorization: Bearer $GITHUB_TOKEN" \ | |
| https://api.github.com/repos/rvben/obsidian-rumdl/dispatches \ | |
| -d "{\"event_type\": \"rumdl_release\", \"client_payload\": {\"version\": \"$VERSION\"}}" | |
| - name: Extract release notes | |
| run: | | |
| TAG_NAME=${GITHUB_REF#refs/tags/} | |
| VERSION=${TAG_NAME#v} | |
| # Extract changelog if available | |
| if [ -f scripts/extract-changelog.sh ] && [ -f CHANGELOG.md ]; then | |
| chmod +x scripts/extract-changelog.sh | |
| ./scripts/extract-changelog.sh "$VERSION" > release-notes.md || echo "No changelog entry found for $VERSION" > release-notes.md | |
| else | |
| echo "No changelog found" > release-notes.md | |
| fi | |
| # Add downloads table | |
| if [ -f scripts/generate-downloads-table.sh ]; then | |
| chmod +x scripts/generate-downloads-table.sh | |
| echo "" >> release-notes.md | |
| ./scripts/generate-downloads-table.sh "$TAG_NAME" >> release-notes.md | |
| fi | |
| - name: Create Release | |
| if: ${{ inputs.dry_run != true }} | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| body_path: release-notes.md | |
| files: | | |
| artifacts/release-*/rumdl-*.tar.gz | |
| artifacts/release-*/rumdl-*.tar.gz.sha256 | |
| artifacts/release-*/rumdl-*.zip | |
| artifacts/release-*/rumdl-*.zip.sha256 | |
| - name: Test Release Creation (dry run) | |
| if: ${{ inputs.dry_run == true }} | |
| run: | | |
| echo "DRY RUN: Would create release with:" | |
| echo "- Release notes from: release-notes.md" | |
| echo "- Archives:" | |
| find artifacts/release-* \( -name "*.tar.gz*" -o -name "*.zip*" \) -type f 2>/dev/null | sort | |
| - name: Update major version tag | |
| if: ${{ inputs.dry_run != true }} | |
| run: | | |
| # Extract major version (e.g., v0 from v0.0.191) | |
| TAG_NAME=${GITHUB_REF#refs/tags/} | |
| MAJOR_VERSION=${TAG_NAME%%.*} | |
| echo "Updating $MAJOR_VERSION tag to point to $TAG_NAME" | |
| # Configure git for tagging | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| # Force-update the major version tag | |
| git tag -fa "$MAJOR_VERSION" -m "Update $MAJOR_VERSION tag to $TAG_NAME" | |
| git push origin "$MAJOR_VERSION" --force | |
| echo "Users can now use: rvben/rumdl@$MAJOR_VERSION" | |
| - name: Test major version tag update (dry run) | |
| if: ${{ inputs.dry_run == true }} | |
| run: | | |
| TAG_NAME=${GITHUB_REF#refs/tags/} | |
| MAJOR_VERSION=${TAG_NAME%%.*} | |
| echo "DRY RUN: Would update $MAJOR_VERSION tag to point to $TAG_NAME" | |
| - name: Notify rumdl-pre-commit | |
| if: ${{ success() && inputs.dry_run != true }} | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.PRECOMMIT_DISPATCH_TOKEN }} | |
| run: | | |
| TAG_NAME=${GITHUB_REF#refs/tags/} | |
| VERSION=${TAG_NAME#v} | |
| curl -X POST \ | |
| -H "Accept: application/vnd.github+json" \ | |
| -H "Authorization: Bearer $GITHUB_TOKEN" \ | |
| https://api.github.com/repos/rvben/rumdl-pre-commit/dispatches \ | |
| -d "{\"event_type\": \"pypi_release\", \"client_payload\": {\"version\": \"$VERSION\"}}" | |
| - name: Notify rumdl-vscode | |
| if: ${{ success() && inputs.dry_run != true }} | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.VSCODE_DISPATCH_TOKEN }} | |
| run: | | |
| # Extract version from tag | |
| TAG_NAME=${GITHUB_REF#refs/tags/} | |
| VERSION=${TAG_NAME#v} | |
| # Wait for GitHub release to be fully available | |
| echo "Waiting for GitHub release to be available..." | |
| sleep 30 | |
| # Send dispatch with version info | |
| curl -X POST \ | |
| -H "Accept: application/vnd.github+json" \ | |
| -H "Authorization: Bearer $GITHUB_TOKEN" \ | |
| https://api.github.com/repos/rvben/rumdl-vscode/dispatches \ | |
| -d "{\"event_type\": \"rumdl_release\", \"client_payload\": {\"version\": \"$VERSION\"}}" | |
| - name: Notify homebrew-rumdl | |
| if: ${{ success() && inputs.dry_run != true }} | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.HOMEBREW_DISPATCH_TOKEN }} | |
| run: | | |
| # Extract version from tag | |
| TAG_NAME=${GITHUB_REF#refs/tags/} | |
| VERSION=${TAG_NAME#v} | |
| # Wait a bit for archives to be available | |
| echo "Waiting for release archives to be available..." | |
| sleep 10 | |
| # Send dispatch with version info | |
| curl -X POST \ | |
| -H "Accept: application/vnd.github+json" \ | |
| -H "Authorization: Bearer $GITHUB_TOKEN" \ | |
| https://api.github.com/repos/rvben/homebrew-rumdl/dispatches \ | |
| -d "{\"event_type\": \"rumdl_release\", \"client_payload\": {\"version\": \"$VERSION\"}}" | |
| - name: Dry Run Summary | |
| if: ${{ inputs.dry_run == true }} | |
| run: | | |
| echo "## 🧪 Dry Run Complete!" | |
| echo "" | |
| echo "The release pipeline executed successfully in dry-run mode." | |
| echo "All artifacts were built but nothing was published." | |
| echo "" | |
| echo "To do an actual release:" | |
| echo "1. Uncheck 'Dry run mode' when running manually, OR" | |
| echo "2. Create and push a version tag (e.g., v0.0.85)" |