Release #12
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[0-9]*.[0-9]*.[0-9]*" | |
| # Dispatched on a tag ref by auto-release.yml; the version check below | |
| # rejects a dispatch on a branch ref. | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| jobs: | |
| package: | |
| name: Package (${{ matrix.name }}) | |
| runs-on: ${{ matrix.runner }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - name: Linux x64 | |
| runner: ubuntu-22.04 | |
| artifact: linux-x64 | |
| - name: Linux ARM64 | |
| runner: ubuntu-22.04-arm | |
| artifact: linux-arm64 | |
| - name: macOS ARM64 | |
| runner: macos-latest | |
| artifact: macos-arm64 | |
| - name: macOS x64 | |
| runner: macos-15-intel | |
| artifact: macos-x64 | |
| - name: Windows x64 | |
| runner: windows-latest | |
| artifact: windows-x64 | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: actions/setup-java@v6 | |
| with: | |
| distribution: temurin | |
| java-version: 25 | |
| - uses: gradle/actions/setup-gradle@v6 | |
| - name: Resolve release version | |
| shell: bash | |
| run: | | |
| release_version="${GITHUB_REF_NAME#v}" | |
| if [[ ! "$release_version" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then | |
| echo "Unsupported release tag: $GITHUB_REF_NAME" >&2 | |
| exit 1 | |
| fi | |
| echo "RELEASE_VERSION=$release_version" >> "$GITHUB_ENV" | |
| - name: Build and package | |
| shell: bash | |
| run: ./gradlew clean build releaseBundle -PreleaseVersion="$RELEASE_VERSION" | |
| - name: Test installer | |
| if: runner.os != 'Windows' | |
| shell: bash | |
| run: tests/test-install.sh | |
| - name: Test installer | |
| if: runner.os == 'Windows' | |
| shell: pwsh | |
| run: tests/test-install.ps1 | |
| - uses: actions/upload-artifact@v6 | |
| with: | |
| name: release-${{ matrix.artifact }} | |
| path: build/release/* | |
| if-no-files-found: error | |
| compression-level: 0 | |
| publish: | |
| name: Publish GitHub release | |
| needs: package | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: actions/download-artifact@v7 | |
| with: | |
| pattern: release-* | |
| path: release | |
| merge-multiple: true | |
| - name: Verify release assets | |
| shell: bash | |
| run: | | |
| cd release | |
| assets=( | |
| jmix-cli-linux-x64.tar.gz | |
| jmix-cli-linux-arm64.tar.gz | |
| jmix-cli-macos-x64.tar.gz | |
| jmix-cli-macos-arm64.tar.gz | |
| jmix-cli-windows-x64.zip | |
| ) | |
| for asset in "${assets[@]}"; do | |
| test -f "$asset" | |
| test -f "$asset.sha256" | |
| sha256sum --check "$asset.sha256" | |
| done | |
| test "$(find . -maxdepth 1 -type f | wc -l)" -eq 10 | |
| - name: Add bootstrap installers | |
| run: | | |
| cp install.sh release/install.sh | |
| cp install.ps1 release/install.ps1 | |
| - name: Create release | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: >- | |
| gh release create "$GITHUB_REF_NAME" release/* | |
| --repo "$GITHUB_REPOSITORY" | |
| --verify-tag | |
| --generate-notes | |
| --title "Jmix CLI $GITHUB_REF_NAME" |