Skip to content

Build & Release

Build & Release #131

Workflow file for this run

name: "Build & Release"
on:
workflow_dispatch:
branches: main
jobs:
build:
name: Build & Release
runs-on: windows-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Setup-Java
uses: actions/setup-java@v3.12.0
with:
distribution: 'oracle'
java-version: '17'
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: '3.19.4'
channel: 'stable'
- name: Install Dependencies
run: flutter pub get
- name: Create .env file
run: echo "CLIENT_ID = XXXXX\nCLIENT_SECRET = XXXX EOF" > assets/.env
- name: Create keystore file
run: |
$b64 = "${{ secrets.KEY_STORE }}"
$filename = "./android/bloomee.jks"
$bytes = [Convert]::FromBase64String($b64)
[IO.File]::WriteAllBytes($filename, $bytes)
# run: echo "${{ secrets.KEY_STORE }}" | base64 --decode > ./android/bloomee.jks
- name: Create Keystore properties
run: |
echo keyPassword=\${{ secrets.KEY_PASSWORD }} > ./android/key.properties
echo storePassword=\${{ secrets.STORE_PASSWORD }} >> ./android/key.properties
echo keyAlias=\${{ secrets.KEY_ALIAS }} >> ./android/key.properties
- name: Build App files
run: flutter build apk --release --build-number ${{github.run_number}}
- name: Verify Sign
run: jarsigner --verify --verbose build/app/outputs/flutter-apk/app-release.apk
- name: Rename APK file
run: Rename-Item -Path "build/app/outputs/flutter-apk/app-release.apk" -NewName "bloomee_tunes_android_v2.9.5+${{github.run_number}}.apk"
- name: Build Windows App
run: flutter build windows --release --build-number ${{github.run_number}}
- name: Rename file
run: Rename-Item -Path "build/windows/x64/runner/Release/bloomee.exe" -NewName "Bloomee.exe"
- name: ZIP build
run: Compress-Archive -Path build/windows/x64/runner/Release/* -Destination build/windows/x64/bloomee_tunes_windows_x64_v2.9.5+${{github.run_number}}.zip
- name: Upload Artifacts
uses: actions/upload-artifact@v2
with:
name: Release
path: |
build/app/outputs/flutter-apk/bloomee_tunes_android_v2.9.5+${{github.run_number}}.apk
build/windows/x64/bloomee_tunes_windows_x64_v2.9.5+${{github.run_number}}.zip
- name: Create Release
uses: ncipollo/release-action@v1
with:
artifacts: |
build/windows/x64/bloomee_tunes_windows_x64_v2.9.5+${{github.run_number}}.zip
build/app/outputs/flutter-apk/bloomee_tunes_android_v2.9.5+${{github.run_number}}.apk
tag: v2.9.5+${{github.run_number}}
token: ${{secrets.SECRET_KEY}}
prerelease: true