This repository was archived by the owner on Jul 29, 2026. It is now read-only.
Release 0.8.0 #21
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: Prepare Release | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| tag: | |
| description: Release tag to publish | |
| required: true | |
| type: string | |
| push: | |
| tags: | |
| - '*' | |
| permissions: | |
| contents: write | |
| id-token: write | |
| jobs: | |
| verify-generated-project: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: ubuntu-latest | |
| gradle_command: ./gradlew | |
| - os: macos-latest | |
| gradle_command: ./gradlew | |
| - os: windows-latest | |
| gradle_command: .\gradlew.bat | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| ref: ${{ github.event_name == 'workflow_dispatch' && inputs.tag || github.ref }} | |
| - run: git fetch --tags -f | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v5 | |
| with: | |
| java-version: '17' | |
| distribution: 'temurin' | |
| token: ${{ github.token }} | |
| - name: Cache Gradle packages | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.gradle/caches | |
| ~/.gradle/wrapper | |
| key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
| restore-keys: | | |
| ${{ runner.os }}-gradle- | |
| - name: Run formatting, unit tests, and integration tests | |
| run: ${{ matrix.gradle_command }} spotlessCheck test integrationTest --no-daemon | |
| - name: Check npm package | |
| run: ${{ matrix.gradle_command }} npmPackageCheck --no-daemon | |
| prepare: | |
| needs: verify-generated-project | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| ref: ${{ github.event_name == 'workflow_dispatch' && inputs.tag || github.ref }} | |
| - run: git fetch --tags -f | |
| - name: Resolve version | |
| id: vars | |
| run: | | |
| if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then | |
| TAG_NAME="${{ inputs.tag }}" | |
| else | |
| TAG_NAME="${GITHUB_REF_NAME}" | |
| fi | |
| VERSION=${TAG_NAME#v} | |
| echo "TAG_NAME=$TAG_NAME" >> $GITHUB_ENV | |
| echo "VERSION=$VERSION" >> $GITHUB_ENV | |
| echo "Version: $VERSION" | |
| - name: Validate release metadata | |
| run: | | |
| ACTUAL_VERSION=$(sed -n 's/^composables-cli = "\(.*\)"$/\1/p' gradle/libs.versions.toml) | |
| if [ -z "$ACTUAL_VERSION" ]; then | |
| echo "Failed to resolve version from gradle/libs.versions.toml" >&2 | |
| exit 1 | |
| fi | |
| if [ "$ACTUAL_VERSION" != "$VERSION" ]; then | |
| echo "Tag version '$VERSION' does not match gradle/libs.versions.toml version '$ACTUAL_VERSION'" >&2 | |
| exit 1 | |
| fi | |
| if ! grep -q "^## \[$VERSION\]" CHANGELOG.md; then | |
| echo "CHANGELOG.md is missing a '## [$VERSION]' heading" >&2 | |
| exit 1 | |
| fi | |
| - name: Generate CHANGELOG content | |
| run: | | |
| # Extract the changelog content for this version, excluding the version header | |
| CHANGELOG_CONTENT=$(sed -n "/## \[$VERSION\]/,/## \[/p" CHANGELOG.md | sed '$ d' | tail -n +2) | |
| # Store in environment file for the release step | |
| echo "CHANGELOG_CONTENT<<EOF" >> $GITHUB_ENV | |
| echo "$CHANGELOG_CONTENT" >> $GITHUB_ENV | |
| echo "EOF" >> $GITHUB_ENV | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: '24' | |
| registry-url: 'https://registry.npmjs.org' | |
| package-manager-cache: false | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v5 | |
| with: | |
| java-version: '17' | |
| distribution: 'temurin' | |
| - name: Cache Gradle packages | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.gradle/caches | |
| ~/.gradle/wrapper | |
| key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
| restore-keys: | | |
| ${{ runner.os }}-gradle- | |
| - name: Publish npm package | |
| run: npm publish cli/build/npm/package --access public | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| draft: true | |
| tag_name: ${{ env.TAG_NAME }} | |
| body: ${{ env.CHANGELOG_CONTENT }} | |
| files: | | |
| cli/build/libs/composables.jar |