Workflow: adjusted workflow to build from docker #19
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: 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 | ||
| - name: Build Flutter app using Docker | ||
| run: | | ||
| docker build -t slcmapk . | ||
| docker run --rm \ | ||
| -v ${{ github.workspace }}/build/app/outputs/flutter-apk:/build/app/outputs/flutter-apk \ | ||
| slcmapk | ||
| 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 }} | ||