Build and Release CCloud #1
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: Build and Release CCloud | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| workflow_dispatch: | |
| inputs: | |
| tag: | |
| description: 'Tag to create release for (e.g., v1.0.0)' | |
| required: true | |
| default: 'v1.0.0' | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'zulu' | |
| java-version: '17' | |
| - name: Setup Android SDK | |
| uses: android-actions/setup-android@v3 | |
| - name: Decode Keystore | |
| run: | | |
| echo "${{ secrets.KEY_STORE }}" | base64 --decode > app/keystore.jks | |
| continue-on-error: true | |
| - name: Create keystore properties file | |
| run: | | |
| echo "storePassword=${{ secrets.KEY_STORE_PASSWORD }}" > key.properties | |
| echo "keyPassword=${{ secrets.KEY_PASSWORD }}" >> key.properties | |
| echo "keyAlias=${{ secrets.KEY_ALIAS }}" >> key.properties | |
| echo "storeFile=keystore.jks" >> key.properties | |
| continue-on-error: true | |
| - name: Build APK | |
| run: | | |
| chmod +x ./gradlew | |
| ./gradlew assembleRelease --stacktrace | |
| - name: Rename APK | |
| run: | | |
| mkdir -p release | |
| cp app/build/outputs/apk/release/app-universal-release.apk release/CCloud-universal.apk | |
| - name: Get tag name | |
| id: get_tag | |
| run: | | |
| if [[ $GITHUB_EVENT_NAME == 'workflow_dispatch' ]]; then | |
| TAG_NAME=${{ github.event.inputs.tag }} | |
| else | |
| TAG_NAME=${GITHUB_REF#refs/tags/} | |
| fi | |
| echo "TAG_NAME=$TAG_NAME" >> $GITHUB_ENV | |
| echo "Tag name: $TAG_NAME" | |
| - name: Create Release | |
| id: create_release | |
| uses: softprops/action-gh-release@v1 | |
| with: | |
| tag_name: ${{ env.TAG_NAME }} | |
| name: Release ${{ env.TAG_NAME }} | |
| draft: false | |
| prerelease: false | |
| files: | | |
| release/CCloud-universal.apk | |
| body: | | |
| ## CCloud Release ${{ env.TAG_NAME }} | |
| ### Download | |
| [CCloud APK](https://github.com/${{ github.repository }}/releases/download/${{ env.TAG_NAME }}/CCloud-universal.apk) | |
| ### Installation | |
| 1. Download the APK file | |
| 2. Enable "Install from unknown sources" in your device settings | |
| 3. Open and install the APK |