From 3c062c9ad053e29df01aa3ab2d9dded9d8cb509a Mon Sep 17 00:00:00 2001 From: Rohit Sangwan Date: Sun, 7 Jul 2024 15:06:14 +0530 Subject: [PATCH] Fix workflows (#5) * Fix workflows * Fix GithubToken * Fix workflow * Fix Workflow * Fix Workflow * Test AppVersion * Test AppVersion * Test AppVersion * Test AppVersion * Fix workflow * Fix workflow * Fix workflow * Add Windows * Add MacOs * Fix workflows --- .github/workflows/release_builds.yaml | 53 ++++++++++++++++++++++++--- .vscode/settings.json | 3 ++ distribute_options.yaml | 24 ++++++++++-- pubspec.yaml | 2 +- 4 files changed, 71 insertions(+), 11 deletions(-) diff --git a/.github/workflows/release_builds.yaml b/.github/workflows/release_builds.yaml index 879e25e..3cbaaa8 100644 --- a/.github/workflows/release_builds.yaml +++ b/.github/workflows/release_builds.yaml @@ -1,8 +1,10 @@ +# Available Runners: https://github.com/actions/runner-images?tab=readme-ov-file#available-images name: Release App on: workflow_dispatch: jobs: + # Runs on Linux x64 linux: runs-on: ubuntu-22.04 steps: @@ -12,14 +14,53 @@ jobs: uses: subosito/flutter-action@v2 with: channel: "stable" + - name: Install dependencies + run: sudo apt-get install -y clang cmake ninja-build pkg-config libgtk-3-0 libgtk-3-dev libblkid1 liblzma5 - name: Enable Linux run: flutter config --enable-linux-desktop - - name: Get Dependencies - run: flutter pub get - - name: Generate App Version - id: app_version - run: echo "value=$(yq '.version' pubspec.yaml)" >> $env:GITHUB_OUTPUT - name: Activate Packaging Tool run: dart pub global activate flutter_distributor - name: Release App - run: flutter_distributor release --name dev --jobs linux \ No newline at end of file + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: flutter_distributor release --name publish --jobs linux + + # Runs on Windows x64 + windows: + runs-on: windows-latest + steps: + - name: Git Checkout + uses: actions/checkout@v3 + - name: Apply Flutter Environment + uses: subosito/flutter-action@v2 + with: + channel: "stable" + - name: Enable Windows + run: flutter config --enable-windows-desktop + - name: Activate Packaging Tool + run: dart pub global activate flutter_distributor + - name: Release App + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: flutter_distributor release --name publish --jobs windows + + # Runs on Macos Arm64 + macos: + runs-on: macos-latest + steps: + - name: Git Checkout + uses: actions/checkout@v3 + - name: Install appdmg + run: npm install -g appdmg + - name: Apply Flutter Environment + uses: subosito/flutter-action@v2 + with: + channel: "stable" + - name: Enable MacOS + run: flutter config --enable-macos-desktop + - name: Activate Packaging Tool + run: dart pub global activate flutter_distributor + - name: Release App + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: flutter_distributor release --name publish --jobs macos \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json index ce70ad7..cb1367b 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -2,6 +2,7 @@ "cSpell.words": [ "altsetting", "Appcast", + "appdmg", "assistivetouch", "backsapce", "calloc", @@ -16,6 +17,8 @@ "libcrypto", "libgtk", "libusb", + "marvinpinto", + "mikefarah", "nullptr", "oneplus", "softprops", diff --git a/distribute_options.yaml b/distribute_options.yaml index ccd9571..0d3dfbc 100644 --- a/distribute_options.yaml +++ b/distribute_options.yaml @@ -1,8 +1,24 @@ -# export GITHUB_TOKEN="personal access token" -# flutter_distributor release --name dev +# flutter_distributor release --name bundle output: dist/ +artifact_name: '{{name}}-{{version}}-{{platform}}.{{ext}}' releases: - - name: dev + ## Only Build Locally + - name: bundle + jobs: + - name: macos + package: + platform: macos + target: dmg + - name: windows + package: + platform: windows + target: exe + - name: linux + package: + platform: linux + target: deb + ## Build and publish to github + - name: publish jobs: - name: macos package: @@ -30,4 +46,4 @@ releases: target: github args: repo-owner: rohitsangwan01 - repo-name: uni_control_hub \ No newline at end of file + repo-name: uni_control_hub diff --git a/pubspec.yaml b/pubspec.yaml index c75c1fb..1ff8a22 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,5 @@ name: uni_control_hub -version: 0.0.2+2 +version: 0.0.2 publish_to: none description: Seamlessly Bridge Your Devices environment: