v1.22.4 #114
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release Workflow | |
on: | |
release: | |
types: | |
- created | |
concurrency: | |
group: release_workflow | |
cancel-in-progress: true | |
env: | |
REGISTRY: ghcr.io | |
IMAGE_NAME: ${{ github.repository }} | |
jobs: | |
build_web: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- run: cat .github/workflows/versions.env >> $GITHUB_ENV | |
- uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: ${{ env.FLUTTER_VERSION }} | |
cache: true | |
- name: Install dependencies | |
run: sudo apt-get update && sudo apt-get install nodejs -y | |
- name: Remove Emoji Font | |
run: | | |
rm -rf fonts/NotoEmoji | |
yq -i 'del( .flutter.fonts[] | select(.family == "NotoEmoji") )' pubspec.yaml | |
- run: flutter pub get | |
- name: Prepare web | |
run: ./scripts/prepare-web.sh | |
- name: Build Release Web | |
run: flutter build web --dart-define=FLUTTER_WEB_CANVASKIT_URL=canvaskit/ --release --source-maps --base-href "/web/" | |
- name: Create archive | |
run: tar -czf tawkie-web.tar.gz build/web/ | |
- name: Upload Web Build | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Web Build | |
path: tawkie-web.tar.gz | |
- name: Upload to release | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.PAGES_DEPLOY_TOKEN }} | |
with: | |
upload_url: ${{ github.event.release.upload_url }} | |
asset_path: tawkie-web.tar.gz | |
asset_name: tawkie-web.tar.gz | |
asset_content_type: application/gzip | |
- name: Build Website | |
run: | | |
cd docs && npx tailwindcss -o ./tailwind.css --minify && cd .. | |
mv docs public | |
mv repo public || true | |
mv build/web/ public/web | |
cp public/web -r public/nightly | |
- name: Deploy to GitHub Pages | |
if: startsWith(github.ref, 'refs/tags/v') | |
uses: peaceiris/actions-gh-pages@v4 | |
with: | |
personal_token: ${{ secrets.PAGES_DEPLOY_TOKEN }} | |
publish_dir: ./public | |
publish_branch: gh-pages | |
cname: tawkie.im | |
build_apk: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Free Disk Space (Ubuntu) | |
uses: jlumbroso/[email protected] | |
with: | |
# this might remove tools that are actually needed, | |
# if set to "true" but frees about 6 GB | |
tool-cache: false | |
# all of these default to true, but feel free to set to | |
# "false" if necessary for your workflow | |
android: false | |
dotnet: true | |
haskell: true | |
large-packages: true | |
docker-images: true | |
swap-storage: false | |
- uses: actions/checkout@v4 | |
- run: cat .github/workflows/versions.env >> $GITHUB_ENV | |
- uses: actions/setup-java@v4 | |
with: | |
java-version: ${{ env.JAVA_VERSION }} | |
distribution: 'zulu' | |
- uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: ${{ env.FLUTTER_VERSION }} | |
cache: true | |
- name: Apply Google Services Patch | |
run: git apply ./scripts/enable-android-google-services.patch | |
- name: Remove Emoji Font | |
run: | | |
rm -rf fonts/NotoEmoji | |
yq -i 'del( .flutter.fonts[] | select(.family == "NotoEmoji") )' pubspec.yaml | |
- run: flutter pub get | |
- name: Prepare Android Release Build | |
env: | |
FDROID_KEY: ${{ secrets.FDROID_KEY }} | |
FDROID_KEY_PASS: ${{ secrets.FDROID_KEY_PASS }} | |
PLAYSTORE_DEPLOY_KEY: ${{ secrets.PLAYSTORE_DEPLOY_KEY }} | |
run: ./scripts/prepare-android-release.sh | |
- name : Reclaim space with apt clean | |
run: sudo apt clean | |
- run: flutter build apk --release | |
- name: Upload to release | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.PAGES_DEPLOY_TOKEN }} | |
with: | |
upload_url: ${{ github.event.release.upload_url }} | |
asset_path: build/app/outputs/apk/release/app-release.apk | |
asset_name: tawkie.apk | |
asset_content_type: application/vnd.android.package-archive | |
build_linux: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- run: cat .github/workflows/versions.env >> $GITHUB_ENV | |
- uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: ${{ env.FLUTTER_VERSION }} | |
cache: true | |
- name: Install dependencies | |
run: sudo apt-get update && sudo apt-get install curl clang cmake ninja-build pkg-config libgtk-3-dev libblkid-dev liblzma-dev libjsoncpp-dev cmake-data libsecret-1-dev libsecret-1-0 librhash0 libssl-dev -y | |
- run: flutter pub get | |
- run: flutter build linux --release --target-platform linux-x64 | |
- name: Create archive | |
run: tar -czf tawkie-linux-x64.tar.gz -C build/linux/x64/release/bundle/ . | |
- name: Upload to release | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.PAGES_DEPLOY_TOKEN }} | |
with: | |
upload_url: ${{ github.event.release.upload_url }} | |
asset_path: tawkie-linux-x64.tar.gz | |
asset_name: tawkie-linux-x64.tar.gz | |
asset_content_type: application/gzip | |
deploy_playstore: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Free Disk Space (Ubuntu) | |
uses: jlumbroso/[email protected] | |
with: | |
# this might remove tools that are actually needed, | |
# if set to "true" but frees about 6 GB | |
tool-cache: false | |
# all of these default to true, but feel free to set to | |
# "false" if necessary for your workflow | |
android: false | |
dotnet: true | |
haskell: true | |
large-packages: true | |
docker-images: true | |
swap-storage: false | |
- uses: actions/checkout@v4 | |
- run: cat .github/workflows/versions.env >> $GITHUB_ENV | |
- uses: actions/setup-java@v4 | |
with: | |
java-version: ${{ env.JAVA_VERSION }} | |
distribution: 'zulu' | |
- uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: ${{ env.FLUTTER_VERSION }} | |
cache: true | |
# https://github.com/fastlane/fastlane/issues/21944#issuecomment-2037161396 | |
- uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: 3.3 | |
- name: Install Fastlane | |
run: gem install fastlane -NV | |
- name: Apply Google Services Patch | |
run: git apply ./scripts/enable-android-google-services.patch | |
- name: Remove Emoji Font | |
run: | | |
rm -rf fonts/NotoEmoji | |
yq -i 'del( .flutter.fonts[] | select(.family == "NotoEmoji") )' pubspec.yaml | |
- run: flutter pub get | |
- name: Prepare Android Release Build | |
env: | |
FDROID_KEY: ${{ secrets.FDROID_KEY }} | |
FDROID_KEY_PASS: ${{ secrets.FDROID_KEY_PASS }} | |
PLAYSTORE_DEPLOY_KEY: ${{ secrets.PLAYSTORE_DEPLOY_KEY }} | |
run: ./scripts/prepare-android-release.sh | |
- name : Reclaim space with apt clean | |
run: sudo apt clean | |
- name: Build Android Release | |
run: flutter build appbundle --target-platform android-arm,android-arm64,android-x64 | |
- name: Get Tag Name | |
id: tag_name | |
run: echo "::set-output name=tag::$(echo ${GITHUB_REF#refs/tags/})" | |
- name: Deploy Android Release | |
run: | | |
mkdir -p build/android | |
cp build/app/outputs/bundle/release/app-release.aab build/android/ | |
cd android | |
bundle install | |
bundle update fastlane | |
bundle exec fastlane deploy_internal_test | |
# if [[ $GITHUB_REF_NAME == rc* ]]; then | |
# bundle exec fastlane deploy_candidate | |
# else | |
# bundle exec fastlane deploy_release | |
# fi | |
cd .. | |
build_ios: | |
runs-on: macos-14 | |
steps: | |
- uses: maxim-lobanov/setup-xcode@v1 | |
with: | |
xcode-version: '15.3' | |
- uses: actions/checkout@v4 | |
- run: cat .github/workflows/versions.env >> $GITHUB_ENV | |
- uses: actions/setup-java@v4 | |
with: | |
java-version: ${{ env.JAVA_VERSION }} | |
distribution: 'zulu' | |
- name: Apply Google Services Patch | |
run: git apply ./scripts/enable-android-google-services.patch | |
- uses: subosito/flutter-action@v2 | |
with: | |
flutter-version: ${{ env.FLUTTER_VERSION }} | |
cache: true | |
- name: Remove Emoji Font | |
run: | | |
rm -rf fonts/NotoEmoji | |
yq -i 'del( .flutter.fonts[] | select(.family == "NotoEmoji") )' pubspec.yaml | |
- run: flutter pub get | |
- run: cd ios && pod install && cd .. | |
- name: Set up ruby env | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: '3.3' # Not needed with a .ruby-version file | |
bundler-cache: true # runs 'bundle install' and caches installed gems automatically | |
- name: Install Fastlane | |
run: gem install fastlane -NV | |
- name: Decode signing certificate into a file | |
env: | |
CERTIFICATE_BASE64: ${{ secrets.IOS_DIST_SIGNING_KEY }} | |
run: | | |
cd ios && echo $CERTIFICATE_BASE64 | base64 --decode > signing-cert.p12 && cd .. | |
- name: Build & upload iOS binary | |
run: cd ios && fastlane beta | |
env: | |
ASC_KEY_ID: ${{ secrets.ASC_KEY_ID }} | |
ASC_ISSUER_ID: ${{ secrets.ASC_ISSUER_ID }} | |
ASC_KEY: ${{ secrets.ASC_PRIVATE_KEY }} | |
SIGNING_KEY_PASSWORD: ${{ secrets.IOS_DIST_SIGNING_KEY_PASSWORD }} | |
SIGNING_KEY_FILE_PATH: signing-cert.p12 | |
build_windows: | |
runs-on: windows-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
# Checks and downloads project source code from GitHub repository | |
- name: Setup environment variables | |
run: cat .github/workflows/versions.env >> $GITHUB_ENV | |
# Load environment variables from versions.env file | |
- name: Get tag | |
id: tag | |
run: | | |
echo "TAG=$(git describe --tags)" >> $GITHUB_ENV | |
shell: bash | |
- name: Prepare Windows environment | |
run: ./scripts/prepare-windows.ps1 | |
shell: pwsh | |
# Executes PowerShell script to prepare Windows environment | |
- name: Build OLM library for Windows | |
run: ./scripts/build-olm-windows.sh | |
shell: bash | |
# Run the Olm compiler script for cryptography if use Matrix | |
- name: Get Flutter dependencies | |
run: | | |
"C:\\tools\\flutter\\bin\\flutter" pub get | |
shell: cmd | |
- name: Build Windows Release | |
run: | | |
"C:\\tools\\flutter\\bin\\flutter" build windows --release | |
shell: cmd | |
# Install Inno Setup via Chocolatey | |
- name: Install Inno Setup | |
run: choco install innosetup --confirm | |
shell: cmd | |
# Use the Inno Setup script to create the installer | |
- name: Create Installer | |
run: | | |
"C:\\Program Files (x86)\\Inno Setup 6\\ISCC.exe" /dMyAppVersion=${{ env.TAG }} scripts/installer.iss | |
shell: cmd | |
# Upload archive to GitHub release page | |
- name: Upload Windows Installer to GitHub | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.PAGES_DEPLOY_TOKEN }} | |
with: | |
upload_url: ${{ github.event.release.upload_url }} | |
asset_path: "build/windows/x64/runner/Release/TawkieInstaller.exe" | |
asset_name: "TawkieInstaller-${{ env.TAG }}.exe" | |
asset_content_type: application/vnd.microsoft.portable-executable | |
# promote_snapcraft: | |
# runs-on: ubuntu-latest | |
# env: | |
# SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_TOKEN }} | |
# steps: | |
# - name: Check out Git repository | |
# uses: actions/checkout@v4 | |
# - name: Install Snapcraft | |
# uses: samuelmeuli/action-snapcraft@v2 | |
# - name: Get Tag Name | |
# id: tag_name | |
# run: echo "::set-output name=tag::$(echo ${GITHUB_REF#refs/tags/})" | |
# - name: Promote Snap | |
# env: # Workaround for https://github.com/snapcore/snapcraft/issues/4439 | |
# SNAPCRAFT_HAS_TTY: "true" | |
# run: | | |
# if [[ $GITHUB_REF_NAME == rc* ]]; then | |
# yes | snapcraft promote fluffychat --from-channel edge --to-channel candidate | |
# else | |
# yes | snapcraft promote fluffychat --from-channel edge --to-channel stable | |
# fi |