Skip to content

Create GitHub Release and upload build to release #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .github/workflows/apk-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
81 changes: 74 additions & 7 deletions .github/workflows/desktop-and-mobile-builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
- name: Upload Linux Artifact
uses: actions/[email protected]
with:
name: linux-build-artifact
name: linux-flet
path: build/linux
if-no-files-found: warn
overwrite: false
Expand Down Expand Up @@ -95,7 +95,7 @@ jobs:
- name: Upload macOS Artifact
uses: actions/[email protected]
with:
name: macos-build-artifact
name: macos-flet
path: build/macos
if-no-files-found: warn
overwrite: false
Expand Down Expand Up @@ -130,7 +130,7 @@ jobs:
- name: Upload Windows Artifact
uses: actions/[email protected]
with:
name: windows-build-artifact
name: windows-flet
path: build/windows
if-no-files-found: warn
overwrite: false
Expand Down Expand Up @@ -165,7 +165,7 @@ jobs:
- name: Upload AAB Artifact
uses: actions/[email protected]
with:
name: aab-build-artifact
name: aab-flet
path: build/aab
if-no-files-found: warn
overwrite: false
Expand Down Expand Up @@ -206,7 +206,7 @@ jobs:
- name: Upload APK Artifact
uses: actions/[email protected]
with:
name: apk-build-artifact
name: apk-flet
path: build/apk
if-no-files-found: warn
overwrite: false
Expand Down Expand Up @@ -241,7 +241,74 @@ jobs:
- name: Upload IPA Artifact
uses: actions/[email protected]
with:
name: ipa-build-artifact
name: ipa-flet
path: build/ipa
if-no-files-found: warn
overwrite: false
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
63 changes: 55 additions & 8 deletions .github/workflows/desktop-builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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/[email protected]
with:
name: linux-build-artifact
name: flet-linux
path: build/linux
if-no-files-found: warn
overwrite: false
Expand Down Expand Up @@ -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/[email protected]
with:
name: macos-build-artifact
name: flet-macos
path: build/macos
if-no-files-found: warn
overwrite: false
Expand Down Expand Up @@ -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/[email protected]
with:
name: windows-build-artifact
name: flet-windows
path: build/windows
if-no-files-found: warn
overwrite: false
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
57 changes: 56 additions & 1 deletion .github/workflows/ipa-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,63 @@ jobs:
- name: Upload IPA Artifact
uses: actions/[email protected] # 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
28 changes: 28 additions & 0 deletions .github/workflows/windows-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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