Fix release workflow #4
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 Builds | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| jobs: | |
| build-android: | |
| name: Build Android APK | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '17' | |
| cache: 'gradle' | |
| - name: Grant execute permission for gradlew | |
| run: chmod +x gradlew | |
| - name: Build Android Release APK | |
| run: ./gradlew :app:assembleRelease | |
| - name: Sign APK (if secrets are configured) | |
| continue-on-error: true | |
| uses: r0adkll/sign-android-release@v1 | |
| id: sign_app | |
| with: | |
| releaseDirectory: app/build/outputs/apk/release | |
| signingKeyBase64: ${{ secrets.SIGNING_KEY }} | |
| alias: ${{ secrets.ALIAS }} | |
| keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }} | |
| keyPassword: ${{ secrets.KEY_PASSWORD }} | |
| env: | |
| BUILD_TOOLS_VERSION: "34.0.0" | |
| - name: Rename signed APK | |
| if: steps.sign_app.outcome == 'success' | |
| run: | | |
| mv ${{steps.sign_app.outputs.signedReleaseFile}} klokk-android.apk | |
| - name: Rename unsigned APK | |
| if: steps.sign_app.outcome != 'success' | |
| run: | | |
| mv app/build/outputs/apk/release/app-release-unsigned.apk klokk-android.apk | |
| - name: Upload Android APK | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: android-apk | |
| path: klokk-android.apk | |
| build-desktop-windows: | |
| name: Build Windows Desktop | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '17' | |
| cache: 'gradle' | |
| - name: Build Windows MSI | |
| run: ./gradlew :desktopApp:packageMsi | |
| - name: Find MSI file | |
| shell: bash | |
| run: | | |
| MSI_FILE=$(find desktopApp/build/compose/binaries/main/msi -name "*.msi" | head -n 1) | |
| echo "MSI_FILE=$MSI_FILE" >> $GITHUB_ENV | |
| cp "$MSI_FILE" klokk-windows.msi | |
| - name: Upload Windows MSI | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: windows-msi | |
| path: klokk-windows.msi | |
| build-desktop-macos: | |
| name: Build macOS Desktop | |
| runs-on: macos-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '17' | |
| cache: 'gradle' | |
| - name: Grant execute permission for gradlew | |
| run: chmod +x gradlew | |
| - name: Build macOS DMG | |
| run: ./gradlew :desktopApp:packageDmg | |
| - name: Find DMG file | |
| run: | | |
| DMG_FILE=$(find desktopApp/build/compose/binaries/main/dmg -name "*.dmg" | head -n 1) | |
| echo "DMG_FILE=$DMG_FILE" >> $GITHUB_ENV | |
| cp "$DMG_FILE" klokk-macos.dmg | |
| - name: Upload macOS DMG | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: macos-dmg | |
| path: klokk-macos.dmg | |
| build-desktop-linux: | |
| name: Build Linux Desktop | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'temurin' | |
| java-version: '17' | |
| cache: 'gradle' | |
| - name: Grant execute permission for gradlew | |
| run: chmod +x gradlew | |
| - name: Build Linux DEB | |
| run: ./gradlew :desktopApp:packageDeb | |
| - name: Find DEB file | |
| run: | | |
| DEB_FILE=$(find desktopApp/build/compose/binaries/main/deb -name "*.deb" | head -n 1) | |
| echo "DEB_FILE=$DEB_FILE" >> $GITHUB_ENV | |
| cp "$DEB_FILE" klokk-linux.deb | |
| - name: Upload Linux DEB | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: linux-deb | |
| path: klokk-linux.deb | |
| create-release: | |
| name: Create GitHub Release | |
| needs: [build-android, build-desktop-windows, build-desktop-macos, build-desktop-linux] | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: artifacts | |
| - name: Generate Release Notes | |
| id: release_notes | |
| run: | | |
| # Get the previous tag | |
| PREVIOUS_TAG=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || echo "") | |
| CURRENT_TAG=${GITHUB_REF#refs/tags/} | |
| echo "## 🎉 What's New in $CURRENT_TAG" > release_notes.md | |
| echo "" >> release_notes.md | |
| if [ -z "$PREVIOUS_TAG" ]; then | |
| echo "### Changes" >> release_notes.md | |
| git log --pretty=format:"- %s" >> release_notes.md | |
| else | |
| echo "### Changes since $PREVIOUS_TAG" >> release_notes.md | |
| git log $PREVIOUS_TAG..HEAD --pretty=format:"- %s" >> release_notes.md | |
| fi | |
| echo "" >> release_notes.md | |
| echo "" >> release_notes.md | |
| echo "## 📦 Downloads" >> release_notes.md | |
| echo "" >> release_notes.md | |
| echo "Choose the appropriate package for your platform:" >> release_notes.md | |
| echo "" >> release_notes.md | |
| echo "- **Android Mobile & TV** - \`klokk-android.apk\`" >> release_notes.md | |
| echo "- **Windows** - \`klokk-windows.msi\`" >> release_notes.md | |
| echo "- **macOS** - \`klokk-macos.dmg\`" >> release_notes.md | |
| echo "- **Linux** - \`klokk-linux.deb\`" >> release_notes.md | |
| echo "" >> release_notes.md | |
| echo "## ✨ Features" >> release_notes.md | |
| echo "" >> release_notes.md | |
| echo "- 🎨 Beautiful kinetic clock animations" >> release_notes.md | |
| echo "- 📱 Works on Android Mobile, Android TV, and Desktop" >> release_notes.md | |
| echo "- 🎬 Multiple animation patterns (Square, Flower, Star, Wave, Ripple, Time)" >> release_notes.md | |
| echo "- 🎮 Immersive mode (tap screen or press back to exit)" >> release_notes.md | |
| echo "- 🔄 Auto-play or manual control" >> release_notes.md | |
| echo "- 💤 Screen stays on during animations" >> release_notes.md | |
| cat release_notes.md | |
| - name: Create Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: | | |
| artifacts/android-apk/klokk-android.apk | |
| artifacts/windows-msi/klokk-windows.msi | |
| artifacts/macos-dmg/klokk-macos.dmg | |
| artifacts/linux-deb/klokk-linux.deb | |
| body_path: release_notes.md | |
| draft: false | |
| prerelease: false | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |