Nightly Release #43
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: Nightly Release | |
| on: | |
| schedule: | |
| - cron: "0 0 * * *" # This runs at midnight UTC every day | |
| workflow_dispatch: # This allows the workflow to be triggered manually | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| steps: | |
| - name: Check out the repository | |
| uses: actions/checkout@v4.2.2 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Delete existing nightly release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: bash clearRelease.sh | |
| build: | |
| name: Build, Sign & Release | |
| runs-on: ubuntu-latest | |
| needs: release | |
| steps: | |
| - name: Checkout project | |
| uses: actions/checkout@v4.2.2 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: set up JDK 17 | |
| uses: actions/setup-java@v4.7.1 | |
| with: | |
| java-version: "17" | |
| distribution: "temurin" | |
| cache: gradle | |
| - name: Grant execute permission for gradlew | |
| run: chmod +x gradlew | |
| - name: Stop Gradle daemons | |
| run: ./gradlew --stop | |
| - name: Decode keystore | |
| id: write_base64_file | |
| shell: bash | |
| run: | | |
| echo "${{ secrets.SIGNINGKEY_BASE64 }}" > mLauncher.jks.tmp | |
| base64 -d -i mLauncher.jks.tmp > mLauncher.jks | |
| rm mLauncher.jks.tmp | |
| mkdir -p app | |
| mv mLauncher.jks app/ | |
| DESTINATION_FILE="app/mLauncher.jks" | |
| echo "filePath=$DESTINATION_FILE" >> "$GITHUB_OUTPUT" | |
| echo "Keystore written to $DESTINATION_FILE" | |
| - name: Build with Gradle | |
| run: ./gradlew clean assembleNightlyRelease --refresh-dependencies --no-daemon | |
| env: | |
| JAVA_TOOL_OPTIONS: "-Dhttps.protocols=TLSv1.2" | |
| KEY_STORE_FILE: ${{ steps.write_base64_file.outputs.filePath }} | |
| KEY_STORE_PASSWORD: ${{ secrets.KEY_STORE_PASSWORD }} | |
| KEY_ALIAS: ${{ secrets.KEY_ALIAS }} | |
| KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }} | |
| - name: Secure keystore cleanup | |
| if: always() | |
| shell: bash | |
| run: | | |
| shred -u app/mLauncher.jks || rm -f app/mLauncher.jks | |
| - name: Extract Version | |
| id: extract_version | |
| run: | | |
| version=$(date +"%Y.%m.%d") | |
| echo "version=$version" >> $GITHUB_ENV | |
| shell: bash | |
| - name: Create Git Tag | |
| run: | | |
| git tag nightly-${{ env.version }} | |
| git push origin nightly-${{ env.version }} | |
| shell: bash | |
| - name: Rename files | |
| run: | | |
| mkdir -p ./build/release/ | |
| mv app/build/outputs/apk/nightly/release/*.apk ./build/release/mLauncher-Nightly-Signed.apk | |
| shell: bash | |
| - name: Create and Upload Release | |
| uses: softprops/action-gh-release@v2.3.2 | |
| with: | |
| tag_name: nightly-${{ env.version }} | |
| name: Nightly Release ${{ env.version }} | |
| body: "" | |
| append_body: false | |
| files: ./build/release/mLauncher-Nightly-Signed.apk | |
| prerelease: true | |
| generate_release_notes: true | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |