Build and Release App v1.0.8 #44
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
| run-name: "Build and Release App ${{ github.ref_name }}" | |
| on: | |
| push: | |
| tags: | |
| - v[0-9]+.[0-9]+.[0-9]+ | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| name: Build & Release App | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v4 | |
| - name: Set Gradle Java Home | |
| run: sed -i '$d' android/gradle.properties | |
| - name: Set Up Java | |
| uses: actions/setup-java@v3 | |
| with: | |
| distribution: "oracle" | |
| java-version: "17" | |
| cache: gradle | |
| - name: Set Up Flutter | |
| uses: subosito/flutter-action@v2 | |
| with: | |
| flutter-version: "3.27.2" | |
| channel: "stable" | |
| cache: true | |
| - name: Decode Keystore | |
| run: | | |
| echo "${{ secrets.KEYSTORE_BASE64 }}" | base64 --decode > upload-keystore.jks | |
| echo "${{ secrets.KEYSTORE_BASE64 }}" | base64 --decode > android/upload-keystore.jks | |
| - name: Create key.properties | |
| run: | | |
| echo "storePassword=${{ secrets.KEYSTORE_PASSWORD }}" > android/key.properties | |
| echo "keyPassword=${{ secrets.KEY_PASSWORD }}" >> android/key.properties | |
| echo "keyAlias=${{ secrets.KEY_ALIAS }}" >> android/key.properties | |
| echo "storeFile=upload-keystore.jks" >> android/key.properties | |
| cat android/key.properties | |
| - name: Install Dependencies | |
| run: flutter pub get | |
| - name: Build APK | |
| run: flutter build apk --release | |
| - name: Upload APK | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: release-apk | |
| path: build/app/outputs/flutter-apk/app-release.apk | |
| release: | |
| name: Create Release | |
| needs: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v4 | |
| - run: echo "today=$(date -I)" >> $GITHUB_ENV | |
| - name: Download APK | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: release-apk | |
| path: artifacts/ | |
| - run: mv artifacts/app-release.apk artifacts/slcm-switch-${{ github.ref_name }}-${{ env.today }}.apk | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| files: artifacts/slcm-switch-${{ github.ref_name }}-${{ env.today }}.apk | |
| tag_name: ${{ github.ref_name }} | |
| name: "Release version ${{ github.ref_name }}" | |
| body: "Automated release for version ${{ github.ref_name }}" | |
| draft: false | |
| prerelease: false | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |