mirror of
https://github.com/VibedByKaKi/commet.git
synced 2026-11-10 16:52:52 +01:00
553 lines
No EOL
18 KiB
YAML
553 lines
No EOL
18 KiB
YAML
|
|
name: release
|
|
on:
|
|
release:
|
|
types:
|
|
- created
|
|
workflow_dispatch:
|
|
|
|
env:
|
|
PROJECT_PATH: commet
|
|
COMMET_PROD: 1
|
|
|
|
jobs:
|
|
release-windows:
|
|
runs-on: windows-2022
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v2
|
|
with:
|
|
submodules: 'true'
|
|
|
|
- name: Setup Flutter
|
|
uses: subosito/flutter-action@v2.8.0
|
|
with:
|
|
flutter-version: '3.41.9'
|
|
channel: 'stable'
|
|
|
|
- name: Configure Flutter
|
|
run: flutter config --enable-windows-desktop
|
|
|
|
- name: Code Generation
|
|
run: |
|
|
cd .\commet
|
|
git config --global core.longpaths true
|
|
dart run scripts/codegen.dart
|
|
|
|
- name: Build Windows App
|
|
run: |
|
|
cd .\commet
|
|
dart run scripts/build_release.dart --platform windows --version_tag ${{ github.event.release.tag_name || 'v0.0.0-artifact' }} --git_hash ${{ github.sha }}
|
|
|
|
- name: Archive
|
|
run: tar -a -c -f commet-windows.zip -C .\commet\build\windows\x64\runner\ Release
|
|
|
|
- name: Upload to release
|
|
if: github.event_name == 'release'
|
|
uses: actions/upload-release-asset@v1
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
upload_url: ${{ github.event.release.upload_url }}
|
|
asset_path: .\commet-windows.zip
|
|
asset_name: commet-windows.zip
|
|
asset_content_type: application/zip
|
|
|
|
- name: Upload Artifact
|
|
if: github.event_name == 'workflow_dispatch'
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: commet-windows.zip
|
|
path: .\commet-windows.zip
|
|
|
|
|
|
release-android:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
# we were having issues running out of disk space on workers, so...
|
|
- name: Aggressive cleanup
|
|
run: |
|
|
# Remove .NET SDKs
|
|
sudo rm -rf /usr/share/dotnet
|
|
|
|
# Remove Haskell (GHC)
|
|
sudo rm -rf /usr/local/.ghcup
|
|
|
|
# Remove Julia
|
|
sudo rm -rf /usr/local/julia*
|
|
|
|
# Remove Chromium (optional if not using for browser tests)
|
|
sudo rm -rf /usr/local/share/chromium
|
|
|
|
# Remove Microsoft/Edge and Google Chrome builds
|
|
sudo rm -rf /opt/microsoft /opt/google
|
|
|
|
# Remove Azure CLI
|
|
sudo rm -rf /opt/az
|
|
|
|
# Remove CodeQL and other toolcaches
|
|
sudo rm -rf /opt/hostedtoolcache
|
|
|
|
docker system prune -af || true
|
|
docker builder prune -af || true
|
|
df -h
|
|
- name: Checkout
|
|
uses: actions/checkout@v2
|
|
with:
|
|
submodules: 'true'
|
|
|
|
- name: Setup Flutter
|
|
uses: subosito/flutter-action@v2.8.0
|
|
with:
|
|
flutter-version: '3.41.9'
|
|
channel: 'stable'
|
|
|
|
- name: Setup Java
|
|
uses: actions/setup-java@v1
|
|
with:
|
|
java-version: 17
|
|
|
|
- name: Setup Tools
|
|
run: |
|
|
sudo apt-get update -y
|
|
sudo apt-get install -y ninja-build libgtk-3-dev libmpv-dev mpv ffmpeg
|
|
|
|
- name: Code Generation
|
|
run: |
|
|
cd $PROJECT_PATH
|
|
dart run scripts/codegen.dart
|
|
|
|
- name: Setup Signatures
|
|
run: |
|
|
cd $PROJECT_PATH
|
|
dart run scripts/setup_android_release.dart --key_password ${{ secrets.ANDROID_KEY_PASSWORD }} --key_b64 ${{ secrets.ANDROID_KEY_STORE_B64 }} --key_alias ${{ secrets.ANDROID_KEY_ALIAS || 'key' }}
|
|
|
|
- name: Build APK
|
|
run: |
|
|
cd $PROJECT_PATH
|
|
dart run scripts/build_release.dart --platform android --version_tag ${{ github.event.release.tag_name || 'v0.0.0-artifact' }} --git_hash ${{ github.sha }}
|
|
|
|
- name: Upload to release
|
|
if: github.event_name == 'release'
|
|
uses: actions/upload-release-asset@v1
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
upload_url: ${{ github.event.release.upload_url }}
|
|
asset_path: commet/build/app/outputs/flutter-apk/app-release.apk
|
|
asset_name: commet-android.apk
|
|
asset_content_type: application/vnd.android.package-archive
|
|
|
|
- name: Upload Artifact
|
|
if: github.event_name == 'workflow_dispatch'
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: commet-android.apk
|
|
path: commet/build/app/outputs/flutter-apk/app-release.apk
|
|
|
|
release-android-google-services:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
# we were having issues running out of disk space on workers, so...
|
|
- name: Aggressive cleanup
|
|
run: |
|
|
# Remove .NET SDKs
|
|
sudo rm -rf /usr/share/dotnet
|
|
|
|
# Remove Haskell (GHC)
|
|
sudo rm -rf /usr/local/.ghcup
|
|
|
|
# Remove Julia
|
|
sudo rm -rf /usr/local/julia*
|
|
|
|
# Remove Chromium (optional if not using for browser tests)
|
|
sudo rm -rf /usr/local/share/chromium
|
|
|
|
# Remove Microsoft/Edge and Google Chrome builds
|
|
sudo rm -rf /opt/microsoft /opt/google
|
|
|
|
# Remove Azure CLI
|
|
sudo rm -rf /opt/az
|
|
|
|
# Remove CodeQL and other toolcaches
|
|
sudo rm -rf /opt/hostedtoolcache
|
|
|
|
docker system prune -af || true
|
|
docker builder prune -af || true
|
|
df -h
|
|
|
|
- name: Checkout
|
|
uses: actions/checkout@v2
|
|
with:
|
|
submodules: 'true'
|
|
|
|
- name: Setup Flutter
|
|
uses: subosito/flutter-action@v2.8.0
|
|
with:
|
|
flutter-version: '3.41.9'
|
|
channel: 'stable'
|
|
|
|
- name: Setup Java
|
|
uses: actions/setup-java@v1
|
|
with:
|
|
java-version: 17
|
|
|
|
- name: Setup Tools
|
|
run: |
|
|
sudo apt-get update -y
|
|
sudo apt-get install -y ninja-build libgtk-3-dev libmpv-dev mpv ffmpeg
|
|
|
|
- name: Code Generation
|
|
run: |
|
|
cd $PROJECT_PATH
|
|
git apply scripts/apply_google_services.patch
|
|
dart run scripts/codegen.dart
|
|
|
|
- name: Setup Signatures
|
|
run: |
|
|
cd $PROJECT_PATH
|
|
dart run scripts/setup_android_release.dart --key_password ${{ secrets.ANDROID_KEY_PASSWORD }} --key_b64 ${{ secrets.ANDROID_KEY_STORE_B64 }} --key_alias ${{ secrets.ANDROID_KEY_ALIAS || 'key' }}
|
|
|
|
- name: Build APK
|
|
run: |
|
|
cd $PROJECT_PATH
|
|
dart run scripts/build_release.dart --platform android --version_tag ${{ github.event.release.tag_name || 'v0.0.0-artifact' }} --git_hash ${{ github.sha }} --enable_google_services true --build_detail google_services
|
|
|
|
- name: Upload to release
|
|
if: github.event_name == 'release'
|
|
uses: actions/upload-release-asset@v1
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
upload_url: ${{ github.event.release.upload_url }}
|
|
asset_path: commet/build/app/outputs/flutter-apk/app-release.apk
|
|
asset_name: commet-android-google-services.apk
|
|
asset_content_type: application/vnd.android.package-archive
|
|
|
|
|
|
- name: Upload Artifact
|
|
if: github.event_name == 'workflow_dispatch'
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: commet-android-google-services.apk
|
|
path: commet/build/app/outputs/flutter-apk/app-release.apk
|
|
|
|
release-linux-debian:
|
|
|
|
strategy:
|
|
matrix:
|
|
os: [ubuntu-22.04, ubuntu-24.04]
|
|
runs-on: ${{ matrix.os }}
|
|
steps:
|
|
# we were having issues running out of disk space on workers, so...
|
|
- name: Aggressive cleanup
|
|
run: |
|
|
# Remove .NET SDKs
|
|
sudo rm -rf /usr/share/dotnet
|
|
|
|
# Remove Haskell (GHC)
|
|
sudo rm -rf /usr/local/.ghcup
|
|
|
|
# Remove Julia
|
|
sudo rm -rf /usr/local/julia*
|
|
|
|
# Remove Chromium (optional if not using for browser tests)
|
|
sudo rm -rf /usr/local/share/chromium
|
|
|
|
# Remove Microsoft/Edge and Google Chrome builds
|
|
sudo rm -rf /opt/microsoft /opt/google
|
|
|
|
# Remove Azure CLI
|
|
sudo rm -rf /opt/az
|
|
|
|
# Remove CodeQL and other toolcaches
|
|
sudo rm -rf /opt/hostedtoolcache
|
|
|
|
docker system prune -af || true
|
|
docker builder prune -af || true
|
|
df -h
|
|
|
|
- name: Checkout
|
|
uses: actions/checkout@v2
|
|
with:
|
|
submodules: 'true'
|
|
|
|
- name: Setup Flutter
|
|
uses: subosito/flutter-action@v2.8.0
|
|
with:
|
|
flutter-version: '3.41.9'
|
|
channel: 'stable'
|
|
|
|
- name: Setup Tools
|
|
run: |
|
|
sudo apt-get update -y
|
|
sudo apt-get install -y ninja-build libgtk-3-dev libmpv-dev mpv ffmpeg libmimalloc-dev webkit2gtk-4.1 libasound2-dev keybinder-3.0
|
|
|
|
- name: Code Generation
|
|
run: |
|
|
cd $PROJECT_PATH
|
|
dart run scripts/codegen.dart
|
|
|
|
- name: Build Linux
|
|
run: |
|
|
cd $PROJECT_PATH
|
|
dart run scripts/build_release.dart --platform linux --version_tag ${{ github.event.release.tag_name || 'v0.0.0-artifact' }} --git_hash ${{ github.sha }} --build_detail debian
|
|
|
|
- name: Create Package
|
|
run: |
|
|
mv $PROJECT_PATH/linux/debian/DEBIAN/control-${{ matrix.os }} $PROJECT_PATH/linux/debian/DEBIAN/control
|
|
cp -r $PROJECT_PATH/linux/debian ./commet-pkg
|
|
cp -r $PROJECT_PATH/build/linux/x64/release/bundle ./commet-pkg/usr/lib/chat.commet.commetapp
|
|
version=$(echo ${{ github.event.release.tag_name || 'v0.0.0-artifact' }} | grep -oP '[0-9]+([.][0-9]+)+')
|
|
echo $version
|
|
cd ./commet-pkg
|
|
sed -i "s/{{VERSION_TAG}}/$version/g" ./DEBIAN/control
|
|
dpkg-deb --build ./ commet-linux-x64.deb
|
|
|
|
- name: Upload to release
|
|
if: github.event_name == 'release'
|
|
uses: actions/upload-release-asset@v1
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
upload_url: ${{ github.event.release.upload_url }}
|
|
asset_path: commet-pkg/commet-linux-x64.deb
|
|
asset_name: commet-${{ matrix.os }}-x64.deb
|
|
asset_content_type: application/vnd.debian.binary-package
|
|
|
|
- name: Upload Artifact
|
|
if: github.event_name == 'workflow_dispatch'
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: commet-${{ matrix.os }}-x64.deb
|
|
path: commet-pkg/commet-linux-x64.deb
|
|
|
|
release-linux-flatpak:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
# we were having issues running out of disk space on workers, so...
|
|
- name: Aggressive cleanup
|
|
run: |
|
|
# Remove .NET SDKs
|
|
sudo rm -rf /usr/share/dotnet
|
|
|
|
# Remove Haskell (GHC)
|
|
sudo rm -rf /usr/local/.ghcup
|
|
|
|
# Remove Julia
|
|
sudo rm -rf /usr/local/julia*
|
|
|
|
# Remove Chromium (optional if not using for browser tests)
|
|
sudo rm -rf /usr/local/share/chromium
|
|
|
|
# Remove Microsoft/Edge and Google Chrome builds
|
|
sudo rm -rf /opt/microsoft /opt/google
|
|
|
|
# Remove Azure CLI
|
|
sudo rm -rf /opt/az
|
|
|
|
# Remove CodeQL and other toolcaches
|
|
sudo rm -rf /opt/hostedtoolcache
|
|
|
|
docker system prune -af || true
|
|
docker builder prune -af || true
|
|
df -h
|
|
|
|
- name: Checkout
|
|
uses: actions/checkout@v2
|
|
with:
|
|
submodules: 'true'
|
|
|
|
- name: Setup Flutter
|
|
uses: subosito/flutter-action@v2.8.0
|
|
with:
|
|
flutter-version: '3.41.9'
|
|
channel: 'stable'
|
|
|
|
- name: Setup Tools
|
|
run: |
|
|
sudo apt-get update -y
|
|
sudo apt-get install -y ninja-build libgtk-3-dev libmpv-dev mpv ffmpeg libmimalloc-dev flatpak-builder flatpak webkit2gtk-4.1 keybinder-3.0
|
|
|
|
- name: Code Generation
|
|
run: |
|
|
cd $PROJECT_PATH
|
|
dart run scripts/codegen.dart
|
|
|
|
- name: Build Linux
|
|
run: |
|
|
cd $PROJECT_PATH
|
|
dart run scripts/build_release.dart --platform linux --version_tag ${{ github.event.release.tag_name || 'v0.0.0-artifact' }} --git_hash ${{ github.sha }} --build_detail flatpak
|
|
|
|
- name: Create Flatpak
|
|
run: |
|
|
sudo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
|
|
sudo flatpak install -y flathub org.gnome.Platform//51 org.gnome.Sdk//51
|
|
mkdir -p commet/linux/flatpak/commet
|
|
cp -r $PROJECT_PATH/build/linux/x64/release/bundle $PROJECT_PATH/linux/flatpak/commet/bundle
|
|
version=$(echo ${{ github.event.release.tag_name || 'v0.0.0-artifact' }} | grep -oP '[0-9]+([.][0-9]+)+')
|
|
echo $version
|
|
cd $PROJECT_PATH/linux/flatpak
|
|
sed -i "s/{{VERSION_TAG}}/$version/g" ./chat.commet.commetapp.desktop
|
|
sed -i "s/{{VERSION_TAG}}/$version/g" ./chat.commet.commetapp.metainfo.xml
|
|
flatpak-builder --force-clean build-dir chat.commet.commetapp.yaml --repo=repo
|
|
flatpak build-bundle repo chat.commet.commetapp.flatpak chat.commet.commetapp
|
|
|
|
- name: Upload to release
|
|
if: github.event_name == 'release'
|
|
uses: actions/upload-release-asset@v1
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
upload_url: ${{ github.event.release.upload_url }}
|
|
asset_path: commet/linux/flatpak/chat.commet.commetapp.flatpak
|
|
asset_name: chat.commet.commetapp.flatpak
|
|
asset_content_type: application/octet-stream
|
|
|
|
- name: Upload Artifact
|
|
if: github.event_name == 'workflow_dispatch'
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: chat.commet.commetapp.flatpak
|
|
path: commet/linux/flatpak/chat.commet.commetapp.flatpak
|
|
|
|
release-linux-portable:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
# we were having issues running out of disk space on workers, so...
|
|
- name: Aggressive cleanup
|
|
run: |
|
|
# Remove .NET SDKs
|
|
sudo rm -rf /usr/share/dotnet
|
|
|
|
# Remove Haskell (GHC)
|
|
sudo rm -rf /usr/local/.ghcup
|
|
|
|
# Remove Julia
|
|
sudo rm -rf /usr/local/julia*
|
|
|
|
# Remove Chromium (optional if not using for browser tests)
|
|
sudo rm -rf /usr/local/share/chromium
|
|
|
|
# Remove Microsoft/Edge and Google Chrome builds
|
|
sudo rm -rf /opt/microsoft /opt/google
|
|
|
|
# Remove Azure CLI
|
|
sudo rm -rf /opt/az
|
|
|
|
# Remove CodeQL and other toolcaches
|
|
sudo rm -rf /opt/hostedtoolcache
|
|
|
|
docker system prune -af || true
|
|
docker builder prune -af || true
|
|
df -h
|
|
|
|
- name: Checkout
|
|
uses: actions/checkout@v2
|
|
with:
|
|
submodules: 'true'
|
|
|
|
- name: Setup Flutter
|
|
uses: subosito/flutter-action@v2.8.0
|
|
with:
|
|
flutter-version: '3.41.9'
|
|
channel: 'stable'
|
|
|
|
- name: Setup Tools
|
|
run: |
|
|
sudo apt-get update -y
|
|
sudo apt-get install -y ninja-build libgtk-3-dev libmpv-dev mpv ffmpeg libmimalloc-dev webkit2gtk-4.1 keybinder-3.0
|
|
|
|
- name: Code Generation
|
|
run: |
|
|
cd $PROJECT_PATH
|
|
dart run scripts/codegen.dart
|
|
|
|
- name: Build Linux
|
|
run: |
|
|
cd $PROJECT_PATH
|
|
dart run scripts/build_release.dart --platform linux --version_tag ${{ github.event.release.tag_name || 'v0.0.0-artifact' }} --git_hash ${{ github.sha }} --build_detail linux-x64
|
|
|
|
- name: Create archive
|
|
run: |
|
|
cd $PROJECT_PATH/build/linux/x64/release
|
|
tar -czf commet-linux-portable-x64.tar.gz bundle
|
|
|
|
- name: Upload to release
|
|
if: github.event_name == 'release'
|
|
uses: actions/upload-release-asset@v1
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
upload_url: ${{ github.event.release.upload_url }}
|
|
asset_path: commet/build/linux/x64/release/commet-linux-portable-x64.tar.gz
|
|
asset_name: commet-linux-portable-x64.tar.gz
|
|
asset_content_type: application/gzip
|
|
|
|
- name: Upload Artifact
|
|
if: github.event_name == 'workflow_dispatch'
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: commet-linux-portable-x64.tar.gz
|
|
path: commet/build/linux/x64/release/commet-linux-portable-x64.tar.gz
|
|
|
|
|
|
release-web:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v2
|
|
with:
|
|
submodules: 'true'
|
|
|
|
- name: Setup Flutter
|
|
uses: subosito/flutter-action@v2.8.0
|
|
with:
|
|
flutter-version: '3.41.9'
|
|
channel: 'stable'
|
|
|
|
- name: Setup Tools
|
|
run: |
|
|
sudo apt-get update -y
|
|
sudo apt-get install -y ninja-build libgtk-3-dev libmpv-dev mpv ffmpeg webkit2gtk-4.1
|
|
|
|
- name: Code Generation
|
|
run: |
|
|
cd $PROJECT_PATH
|
|
dart run scripts/codegen.dart
|
|
|
|
- uses: moonrepo/setup-rust@v1
|
|
- run: rustup component add rust-src --toolchain nightly-x86_64-unknown-linux-gnu
|
|
|
|
- name: Prepare web
|
|
run: |
|
|
cd $PROJECT_PATH
|
|
./scripts/prepare-web.sh
|
|
|
|
- name: Build Web
|
|
run: |
|
|
cd $PROJECT_PATH
|
|
dart run scripts/build_release.dart --platform web --version_tag ${{ github.event.release.tag_name || 'v0.0.0-artifact' }} --git_hash ${{ github.sha }}
|
|
|
|
- name: Create archive
|
|
run: |
|
|
cd $PROJECT_PATH/build
|
|
tar -czf commet-web.tar.gz web
|
|
|
|
- name: Upload to release
|
|
if: github.event_name == 'release'
|
|
uses: actions/upload-release-asset@v1
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
upload_url: ${{ github.event.release.upload_url }}
|
|
asset_path: commet/build/commet-web.tar.gz
|
|
asset_name: commet-web.tar.gz
|
|
asset_content_type: application/gzip
|
|
|
|
- name: Upload Artifact
|
|
if: github.event_name == 'workflow_dispatch'
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: commet-web.tar.gz
|
|
path: commet/build/commet-web.tar.gz |