diff --git a/.github/workflows/apk-build.yml b/.github/workflows/apk-build.yml index 79612d8..03ca4fa 100644 --- a/.github/workflows/apk-build.yml +++ b/.github/workflows/apk-build.yml @@ -64,3 +64,25 @@ jobs: if-no-files-found: error # Fail the action with an error message if no files are found overwrite: false # If true, an artifact with a matching name will be deleted before a new one is uploaded. If false, the action will fail if an artifact for the given name already exists. Does not fail if the artifact does not exist. + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.TOKEN }} + with: + tag_name: v1.0.2 + release_name: Release 1.0.2 + body: | + ## 🚀 Update ${{ env.BUILD_VERSION }} + draft: false + prerelease: false + - name: Upload Release Asset + id: upload-release-asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./build/apk/app-release.apk + asset_name: app-release.apk + asset_content_type: application/zip \ No newline at end of file diff --git a/.github/workflows/desktop-and-mobile-builds.yml b/.github/workflows/desktop-and-mobile-builds.yml index 82005a8..985fc45 100644 --- a/.github/workflows/desktop-and-mobile-builds.yml +++ b/.github/workflows/desktop-and-mobile-builds.yml @@ -60,7 +60,7 @@ jobs: - name: Upload Linux Artifact uses: actions/upload-artifact@v4.3.4 with: - name: linux-build-artifact + name: linux-flet path: build/linux if-no-files-found: warn overwrite: false @@ -95,7 +95,7 @@ jobs: - name: Upload macOS Artifact uses: actions/upload-artifact@v4.3.4 with: - name: macos-build-artifact + name: macos-flet path: build/macos if-no-files-found: warn overwrite: false @@ -130,7 +130,7 @@ jobs: - name: Upload Windows Artifact uses: actions/upload-artifact@v4.3.4 with: - name: windows-build-artifact + name: windows-flet path: build/windows if-no-files-found: warn overwrite: false @@ -165,7 +165,7 @@ jobs: - name: Upload AAB Artifact uses: actions/upload-artifact@v4.3.4 with: - name: aab-build-artifact + name: aab-flet path: build/aab if-no-files-found: warn overwrite: false @@ -206,7 +206,7 @@ jobs: - name: Upload APK Artifact uses: actions/upload-artifact@v4.3.4 with: - name: apk-build-artifact + name: apk-flet path: build/apk if-no-files-found: warn overwrite: false @@ -241,7 +241,74 @@ jobs: - name: Upload IPA Artifact uses: actions/upload-artifact@v4.3.4 with: - name: ipa-build-artifact + name: ipa-flet path: build/ipa if-no-files-found: warn - overwrite: false \ No newline at end of file + overwrite: false + + + create-release: + needs: [build-linux, build-macos, build-windows, build-aab, build-apk, build-ipa] + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Download all artifacts + uses: actions/download-artifact@v4 + with: + path: artifacts + + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.TOKEN }} #GitHub Token + with: + tag_name: v${{ env.BUILD_VERSION }} + release_name: Release v${{ env.BUILD_VERSION }} + draft: false + prerelease: false + + - name: Zip Artifacts + run: | + cd artifacts + echo "Initial directory structure:" + ls -la + echo "\nShowing ipa-flet contents:" + ls -la ipa-flet/ + echo "\nShowing complete path structure:" + find ipa-flet -type d + mv ipa-flet/Runner.xcarchive/Products/Applications ipa-flet/Payload + echo "\nDirectory structure after mv:" + ls -la ipa-flet/ + cd ipa-flet + zip -r ../ipa-flet.ipa Payload + cd .. + zip -r linux-flet.zip linux-flet/ + zip -r macos-flet.zip macos-flet/ + zip -r windows-flet.zip windows-flet/ + zip -r aab-flet.zip aab-flet/ + + + - name: List Workspace After Zipping + run: | + echo "Artifacts Directory After Zipping:" + ls -la artifacts/ + + - name: Upload Release Assets + uses: softprops/action-gh-release@v1 + with: + files: | + ls -la artifacts/ + artifacts/apk-flet/app-release.apk + artifacts/ipa-flet.ipa + artifacts/windows-flet.zip + artifacts/linux-flet.zip + artifacts/macos-flet.zip + artifacts/aab-flet.zip + tag_name: v${{ env.BUILD_VERSION }} + env: + GITHUB_TOKEN: ${{ secrets.TOKEN }} #GitHub Token \ No newline at end of file diff --git a/.github/workflows/desktop-builds.yml b/.github/workflows/desktop-builds.yml index 12dc95c..143e68e 100644 --- a/.github/workflows/desktop-builds.yml +++ b/.github/workflows/desktop-builds.yml @@ -16,7 +16,6 @@ on: workflow_dispatch: env: - # https://flet.dev/docs/publish#versioning BUILD_NUMBER: 1 BUILD_VERSION: 1.0.0 PYTHON_VERSION: 3.12.2 @@ -55,12 +54,12 @@ jobs: - name: Flet Build Linux run: | flutter config --no-analytics - flet build linux --verbose --build-number=$BUILD_NUMBER --build-version=$BUILD_VERSION + flet build linux --verbose --no-rich-output --project flet --product flet --copyright "Copyright (c) 2024 flet" --build-version=$env:BUILD_VERSION - name: Upload Linux Artifact uses: actions/upload-artifact@v4.3.4 with: - name: linux-build-artifact + name: flet-linux path: build/linux if-no-files-found: warn overwrite: false @@ -90,12 +89,12 @@ jobs: - name: Flet Build macOS run: | flutter config --no-analytics - flet build macos --verbose --build-number=$BUILD_NUMBER --build-version=$BUILD_VERSION + flet build macos --verbose --no-rich-output --project flet --product flet --copyright "Copyright (c) 2024 flet" --build-version=$env:BUILD_VERSION - name: Upload macOS Artifact uses: actions/upload-artifact@v4.3.4 with: - name: macos-build-artifact + name: flet-macos path: build/macos if-no-files-found: warn overwrite: false @@ -125,12 +124,60 @@ jobs: - name: Flet Build Windows run: | flutter config --no-analytics - flet build windows --verbose --no-rich-output --build-number=$env:BUILD_NUMBER --build-version=$env:BUILD_VERSION + flet build windows --verbose --no-rich-output --project flet --product flet --copyright "Copyright (c) 2024 flet" --build-number=$env:BUILD_NUMBER --build-version=$env:BUILD_VERSION - name: Upload Windows Artifact uses: actions/upload-artifact@v4.3.4 with: - name: windows-build-artifact + name: flet-windows path: build/windows if-no-files-found: warn - overwrite: false \ No newline at end of file + overwrite: false + + create-release: + needs: [build-linux, build-macos, build-windows] + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Download all artifacts + uses: actions/download-artifact@v4 + with: + path: artifacts + + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.TOKEN }} #GitHub Token + with: + tag_name: v${{ env.BUILD_VERSION }} + release_name: Release v${{ env.BUILD_VERSION }} + draft: false + prerelease: false + + - name: Zip Artifacts + run: | + cd artifacts + zip -r flet-linux.zip flet-linux/ + zip -r flet-macos.zip flet-macos/ + zip -r flet-windows.zip flet-windows/ + + - name: List Workspace After Zipping + run: | + echo "Artifacts Directory After Zipping:" + ls -la artifacts/ + + - name: Upload Release Assets + uses: softprops/action-gh-release@v1 + with: + files: | + artifacts/flet-linux.zip + artifacts/flet-macos.zip + artifacts/flet-windows.zip + tag_name: v${{ env.BUILD_VERSION }} + env: + GITHUB_TOKEN: ${{ secrets.TOKEN }} #GitHub Token \ No newline at end of file diff --git a/.github/workflows/ipa-build.yml b/.github/workflows/ipa-build.yml index b03010a..7c0fc0d 100644 --- a/.github/workflows/ipa-build.yml +++ b/.github/workflows/ipa-build.yml @@ -53,8 +53,63 @@ jobs: - name: Upload IPA Artifact uses: actions/upload-artifact@v4.3.4 # https://github.com/marketplace/actions/upload-a-build-artifact with: - name: ipa-build-artifact # the name of the artifact + name: ipa-flet # the name of the artifact path: build/ipa # location of Flet build output if-no-files-found: error # Fail the action with an error message if no files are found overwrite: false # If true, an artifact with a matching name will be deleted before a new one is uploaded. If false, the action will fail if an artifact for the given name already exists. Does not fail if the artifact does not exist. + create-release: + needs: [build] + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Download all artifacts + uses: actions/download-artifact@v4 + with: + path: artifacts + + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.TOKEN }} #GitHub Token + with: + tag_name: v${{ env.BUILD_VERSION }} + release_name: Release v${{ env.BUILD_VERSION }} + draft: false + prerelease: false + + - name: Zip Artifacts + run: | + cd artifacts + echo "Initial directory structure:" + ls -la + echo "\nShowing ipa-flet contents:" + ls -la ipa-flet/ + echo "\nShowing complete path structure:" + find ipa-flet -type d + mv ipa-flet/Runner.xcarchive/Products/Applications ipa-flet/Payload + echo "\nDirectory structure after mv:" + ls -la ipa-flet/ + cd ipa-flet + zip -r ../ipa-flet.ipa Payload + cd .. + + - name: List Workspace After Zipping + run: | + echo "Artifacts Directory After Zipping:" + ls -la artifacts/ + + - name: Upload Release Assets + uses: softprops/action-gh-release@v1 + with: + files: | + ls -la artifacts/ + artifacts/ipa-flet.ipa + tag_name: v${{ env.BUILD_VERSION }} + env: + GITHUB_TOKEN: ${{ secrets.TOKEN }} #GitHub Token \ No newline at end of file diff --git a/.github/workflows/windows-build.yml b/.github/workflows/windows-build.yml index d8b19ee..27c5f28 100644 --- a/.github/workflows/windows-build.yml +++ b/.github/workflows/windows-build.yml @@ -59,3 +59,31 @@ jobs: overwrite: false + - name: Compress folder + shell: powershell + run: | + Compress-Archive -Path build/windows -DestinationPath build/Windows.zip + + - name: Create GitHub Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.TOKEN }} + with: + tag_name: v${{ env.BUILD_VERSION }} + release_name: "v${{ env.BUILD_VERSION }}" + body: | + ## 🚀 Update ${{ env.BUILD_VERSION }} + + draft: false + prerelease: false + + - name: Upload Build to Release + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: build/Windows.zip # Path to the zipped file + asset_name: Windows.zip + asset_content_type: application/zip \ No newline at end of file