diff --git a/.github/workflows/build-chrome-ext.yml b/.github/workflows/build-chrome-ext.yml new file mode 100644 index 000000000..8127f23ae --- /dev/null +++ b/.github/workflows/build-chrome-ext.yml @@ -0,0 +1,51 @@ +name: Build and Package Chrome Extension app + +on: + release: + types: + - created + +jobs: + build-chrome-extension: + runs-on: ubuntu-latest + + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + + - name: Set up Node.js + uses: actions/setup-node@v4 + with: + node-version: '21.2' + + - name: Set up Flutter + uses: subosito/flutter-action@v2 + with: + channel: "stable" + flutter-version: '3.22.3' + - run: flutter --version + + - name: Install Flutter dependencies + run: flutter pub get + + - name: Build Chrome Extension + run: bash ./scripts/build_chrome_extension.sh + + - name: Get Version from pubspec.yaml + id: get_version + run: | + version_str=$(grep -oP '(?<=^version: ).*' pubspec.yaml | awk '{$1=$1};1') + echo "version_app=${version_str}" >> $GITHUB_OUTPUT + echo "env_version_app=${version_str}" >> $GITHUB_ENV + + - name: Zip build folder + run: | + cd build/chrome-extension + zip -r ../chrome-extension-${{ steps.get_version.outputs.version_app }}.zip ./ + working-directory: build/chrome-extension + + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: chrome-extension-build-${{ steps.get_version.outputs.version_app }} + path: build/chrome-extension-${{ steps.get_version.outputs.version_app }}.zip diff --git a/.github/workflows/build-linux.yml b/.github/workflows/build-linux.yml new file mode 100644 index 000000000..295153b4a --- /dev/null +++ b/.github/workflows/build-linux.yml @@ -0,0 +1,60 @@ +name: Build and Package Linux app + +on: + release: + types: + - created + +jobs: + build-linux: + runs-on: ubuntu-latest + + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + + - name: Set up Flutter + uses: subosito/flutter-action@v2 + with: + channel: "stable" + flutter-version: '3.22.3' + - run: flutter --version + + - name: Setup Dependencies + run: | + sudo apt-get update + sudo apt-get install clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev libsecret-1-dev libjsoncpp-dev fuse libgtk-3-0 python3-pip libgtkmm-3.0-1v5 libnotify4 gstreamer1.0-tools + + - name: Build Flutter Application + run: flutter build linux --release + + - name: Get Version from pubspec.yaml + id: get_version + run: | + version_str=$(grep -oP '(?<=^version: ).*' pubspec.yaml | awk '{$1=$1};1') + echo "version_app=${version_str}" >> $GITHUB_OUTPUT + echo "env_version_app=${version_str}" >> $GITHUB_ENV + + - name: Install appimage-builder + run: | + wget https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage -O /usr/local/bin/appimagetool + chmod +x /usr/local/bin/appimagetool + sudo pip3 install appimage-builder + + - name: Generate AppImage + run: | + appimage-builder --recipe AppImageBuilder.yml --skip-test + + - name: Check files + run: | + ls -R + + - name: Checksum + run: | + sha256sum archethic_wallet-${{ steps.get_version.outputs.version_app }}-x86_64.AppImage + + - name: Upload AppImage Artifact + uses: actions/upload-artifact@v4 + with: + name: archethic-wallet-${{ steps.get_version.outputs.version_app }}-appimage + path: archethic_wallet-${{ steps.get_version.outputs.version_app }}-x86_64.AppImage \ No newline at end of file diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml new file mode 100644 index 000000000..5364b1556 --- /dev/null +++ b/.github/workflows/build-windows.yml @@ -0,0 +1,65 @@ +name: Build and Package Windows app + +on: + release: + types: + - created + +jobs: + build-windows: + runs-on: windows-latest + + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + + - name: Set up Flutter + uses: subosito/flutter-action@v2 + with: + channel: "stable" + flutter-version: '3.22.3' + - run: flutter --version + + - name: Setup dependencies + run: | + flutter doctor + choco install cmake ninja python3 + choco install -y visualstudio2019buildtools --package-parameters "--add Microsoft.VisualStudio.Component.VC.Tools.x86.x64" + + - name: Build Flutter Application + run: flutter build windows --release + + - name: Publish to store + run: flutter pub run msix:create --store + + - name: Copy MSIX file to /artifacts + run: | + mkdir artifacts + cp build/windows/x64/runner/Release/aewallet.msix artifacts/ + + - name: Get Version from pubspec.yaml + id: get_version + run: | + $version_str=$(gc .\pubspec.yaml | select-string '(?<=^version: ).*' -AllMatches | Select-Object -Expand Matches | %{$_.Value}) + echo "version_app=${version_str}" >> $Env:GITHUB_OUTPUT + + - name: Archive Artifact + run: | + mv build/windows/x64/runner/Release/ archethic-wallet + Compress-Archive -Path archethic-wallet -DestinationPath "artifacts/archethic-wallet-${{ steps.get_version.outputs.version_app }}.zip" + + - name: Checksum + run: | + sha256sum artifacts/archethic-wallet-${{ steps.get_version.outputs.version_app }}.zip + + - name: Upload Artifact MSIX + uses: actions/upload-artifact@v4 + with: + name: aewallet + path: artifacts/aewallet.msix + + - name: Upload Artifact + uses: actions/upload-artifact@v4 + with: + name: archethic-wallet-windows-${{ steps.get_version.outputs.version_app }} + path: artifacts/archethic-wallet-${{ steps.get_version.outputs.version_app }}.zip \ No newline at end of file diff --git a/.github/workflows/desktop-release.yml b/.github/workflows/desktop-release.yml deleted file mode 100644 index 86004d226..000000000 --- a/.github/workflows/desktop-release.yml +++ /dev/null @@ -1,159 +0,0 @@ -name: Build and Package Desktop apps - -on: - release: - types: - - created - -jobs: - build-chrome-extension: - runs-on: ubuntu-latest - - steps: - - name: Checkout Repository - uses: actions/checkout@v4 - - - name: Set up Node.js - uses: actions/setup-node@v4 - with: - node-version: '21.2' - - - name: Set up Flutter - uses: subosito/flutter-action@v2 - with: - channel: "stable" - flutter-version: '3.22.3' - - run: flutter --version - - - name: Install Flutter dependencies - run: flutter pub get - - - name: Build Chrome Extension - run: bash ./scripts/build_chrome_extension.sh - - - name: Get Version from pubspec.yaml - id: get_version - run: | - version_str=$(grep -oP '(?<=^version: ).*' pubspec.yaml | awk '{$1=$1};1') - echo "version_app=${version_str}" >> $GITHUB_OUTPUT - echo "env_version_app=${version_str}" >> $GITHUB_ENV - - - name: Zip build folder - run: zip -r build/chrome-extension-${{ steps.get_version.outputs.version_app }}.zip build/chrome-extension - - - name: Upload artifact - uses: actions/upload-artifact@v4 - with: - name: chrome-extension-build-${{ steps.get_version.outputs.version_app }} - path: build/chrome-extension-${{ steps.get_version.outputs.version_app }}.zip - - build-linux: - runs-on: ubuntu-latest - - steps: - - name: Checkout Repository - uses: actions/checkout@v4 - - - name: Set up Flutter - uses: subosito/flutter-action@v2 - with: - channel: "stable" - flutter-version: '3.22.3' - - run: flutter --version - - - name: Setup Dependencies - run: | - sudo apt-get update - sudo apt-get install clang cmake ninja-build pkg-config libgtk-3-dev liblzma-dev libsecret-1-dev libjsoncpp-dev fuse libgtk-3-0 python3-pip libgtkmm-3.0-1v5 libnotify4 gstreamer1.0-tools - - - name: Build Flutter Application - run: flutter build linux --release - - - name: Get Version from pubspec.yaml - id: get_version - run: | - version_str=$(grep -oP '(?<=^version: ).*' pubspec.yaml | awk '{$1=$1};1') - echo "version_app=${version_str}" >> $GITHUB_OUTPUT - echo "env_version_app=${version_str}" >> $GITHUB_ENV - - - name: Install appimage-builder - run: | - wget https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage -O /usr/local/bin/appimagetool - chmod +x /usr/local/bin/appimagetool - sudo pip3 install appimage-builder - - - name: Generate AppImage - run: | - appimage-builder --recipe AppImageBuilder.yml --skip-test - - - name: Check files - run: | - ls -R - - - name: Checksum - run: | - sha256sum archethic_wallet-${{ steps.get_version.outputs.version_app }}-x86_64.AppImage - - - name: Upload AppImage Artifact - uses: actions/upload-artifact@v4 - with: - name: archethic-wallet-${{ steps.get_version.outputs.version_app }}-appimage - path: archethic_wallet-${{ steps.get_version.outputs.version_app }}-x86_64.AppImage - - build-windows: - runs-on: windows-latest - - steps: - - name: Checkout Repository - uses: actions/checkout@v4 - - - name: Set up Flutter - uses: subosito/flutter-action@v2 - with: - channel: "stable" - flutter-version: '3.22.3' - - run: flutter --version - - - name: Setup dependencies - run: | - flutter doctor - choco install cmake ninja python3 - choco install -y visualstudio2019buildtools --package-parameters "--add Microsoft.VisualStudio.Component.VC.Tools.x86.x64" - - - name: Build Flutter Application - run: flutter build windows --release - - - name: Publish to store - run: flutter pub run msix:create --store - - - name: Copy MSIX file to /artifacts - run: | - mkdir artifacts - cp build/windows/x64/runner/Release/aewallet.msix artifacts/ - - - name: Get Version from pubspec.yaml - id: get_version - run: | - $version_str=$(gc .\pubspec.yaml | select-string '(?<=^version: ).*' -AllMatches | Select-Object -Expand Matches | %{$_.Value}) - echo "version_app=${version_str}" >> $Env:GITHUB_OUTPUT - - - name: Archive Artifact - run: | - mv build/windows/x64/runner/Release/ archethic-wallet - Compress-Archive -Path archethic-wallet -DestinationPath "artifacts/archethic-wallet-${{ steps.get_version.outputs.version_app }}.zip" - - - name: Checksum - run: | - sha256sum artifacts/archethic-wallet-${{ steps.get_version.outputs.version_app }}.zip - - - name: Upload Artifact MSIX - uses: actions/upload-artifact@v4 - with: - name: aewallet - path: artifacts/aewallet.msix - - - name: Upload Artifact - uses: actions/upload-artifact@v4 - with: - name: archethic-wallet-windows-${{ steps.get_version.outputs.version_app }} - path: artifacts/archethic-wallet-${{ steps.get_version.outputs.version_app }}.zip \ No newline at end of file