Skip to content

release

release #58

Workflow file for this run

name: release
on:
release:
types:
- created
workflow_dispatch:
env:
PROJECT_PATH: commet
jobs:
release-windows:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: 'true'
- name: Setup Flutter
uses: subosito/[email protected]
with:
flutter-version: '3.22.3'
channel: 'stable'
- name: Clone Olm
run: git clone https://gitlab.matrix.org/matrix-org/olm.git
- name: Build Olm
run: |
cd ./olm
cmake -DCMAKE_BUILD_TYPE=Release . -A x64 -Bbuild
cmake --build build --config Release
- 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' }} --git_hash ${{ github.sha }}
- name: Include libolm
run: |
dir
dir .\olm
dir .\commet
dir .\commet\build\windows
move .\olm\build\Release\olm.dll .\commet\build\windows\x64\runner\Release\libolm.dll
- 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
release-android:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: 'true'
- name: Setup Flutter
uses: subosito/[email protected]
with:
flutter-version: '3.22.3'
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 libolm3 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 }}
- 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' }} --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
release-android-google-services:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: 'true'
- name: Setup Flutter
uses: subosito/[email protected]
with:
flutter-version: '3.22.3'
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 libolm3 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 }}
- 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' }} --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
release-linux-debian:
strategy:
matrix:
os: [ubuntu-22.04, ubuntu-24.04]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: 'true'
- name: Setup Flutter
uses: subosito/[email protected]
with:
flutter-version: '3.22.3'
channel: 'stable'
- name: Setup Tools
run: |
sudo apt-get update -y
sudo apt-get install -y ninja-build libgtk-3-dev libolm3 libmpv-dev mpv ffmpeg libmimalloc-dev
- 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' }} --git_hash ${{ github.sha }} --build_detail debian
- name: Create Package
run: |
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' }} | 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
release-linux-flatpak:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: 'true'
- name: Setup Flutter
uses: subosito/[email protected]
with:
flutter-version: '3.22.3'
channel: 'stable'
- name: Setup Tools
run: |
sudo apt-get update -y
sudo apt-get install -y ninja-build libgtk-3-dev libolm3 libmpv-dev mpv ffmpeg libmimalloc-dev flatpak-builder flatpak
- 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' }} --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.freedesktop.Platform//23.08 org.freedesktop.Sdk//23.08
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' }} | 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
release-linux-portable:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: 'true'
- name: Setup Flutter
uses: subosito/[email protected]
with:
flutter-version: '3.22.3'
channel: 'stable'
- name: Setup Tools
run: |
sudo apt-get update -y
sudo apt-get install -y ninja-build libgtk-3-dev libolm3 libmpv-dev mpv ffmpeg libmimalloc-dev
- 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' }} --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
release-web:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: 'true'
- name: Setup Flutter
uses: subosito/[email protected]
with:
flutter-version: '3.22.3'
channel: 'stable'
- name: Setup Tools
run: |
sudo apt-get update -y
sudo apt-get install -y ninja-build libgtk-3-dev libolm3 libmpv-dev mpv ffmpeg
- name: Code Generation
run: |
cd $PROJECT_PATH
dart run scripts/codegen.dart
- name: Include Olm
run: |
cd $PROJECT_PATH
cd assets/js
rm -r package
curl -L 'https://gitlab.com/famedly/company/frontend/libraries/olm/-/jobs/artifacts/master/download?job=build:js' > olm.zip
unzip olm.zip
rm olm.zip
mv javascript package
- 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' }} --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