Skip to content

Commit

Permalink
Added debug and release workflows for desktop OSes
Browse files Browse the repository at this point in the history
Use developer ID for signing

Added notarization for macOS app

Change signing identity for debug and release

Use a specific libolm version

Minor modification to Windows setup

Correct installation folder

Uncommented mobile builds
  • Loading branch information
tk-nguyen authored and hoangdat committed Aug 24, 2023
1 parent e20bc9f commit 31042b9
Show file tree
Hide file tree
Showing 33 changed files with 1,711 additions and 111 deletions.
67 changes: 63 additions & 4 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
on:
workflow_dispatch:
schedule:
- cron: '0 11 * * *'
- cron: "0 11 * * *"

name: Build

env:
FLUTTER_VERSION: 3.10.6

jobs:
build_debug:
name: Build debug version
build_debug_mobile:
name: Build debug version for mobiles
runs-on: ${{ matrix.runner }}
strategy:
matrix:
Expand Down Expand Up @@ -72,7 +72,66 @@ jobs:
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: twake-on-matrix-dev
name: twake-on-matrix-dev-mobile
path: |
twake-on-matrix-debug.apk
Runner.ipa
build_debug_desktop:
name: Build debug version for desktops
runs-on: ${{ matrix.runner }}
strategy:
matrix:
include:
- os: macos
runner: macos-latest
- os: windows
runner: windows-latest
- os: linux
runner: ubuntu-latest
fail-fast: false
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: "stable"
cache: true

- uses: webfactory/ssh-agent@v0.8.0
with:
ssh-private-key: ${{ secrets.SSH_KEY }}

- name: Setup
run: |
ssh-keyscan github.com >> ~/.ssh/known_hosts
flutter pub global activate flutter_distributor
shell: bash

- name: Setup Fastlane (macOS only)
uses: ruby/setup-ruby@v1
if: matrix.os == 'macos'
with:
ruby-version: ruby
bundler-cache: true
working-directory: ${{ matrix.os }}

- name: Build
env:
APPLE_CERTIFICATES_SSH_KEY: ${{ secrets.APPLE_CERTIFICATES_SSH_KEY }}
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
run: ./scripts/build-${{ matrix.os }}-debug.sh
shell: bash

- name: Package
run: ./scripts/package-${{ matrix.os }}-debug.sh
shell: bash

- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: twake-on-matrix-dev-${{ matrix.os }}
path: dist/
121 changes: 119 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ env:
name: Release app

jobs:
release:
name: Release on stores
release_mobile:
name: Release on mobile stores
runs-on: ${{ matrix.runner }}
environment: prod

Expand Down Expand Up @@ -83,3 +83,120 @@ jobs:
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
run: ../scripts/release-ios-testflight.sh
working-directory: ${{ matrix.os }}

package_desktop:
name: Package app on desktops
runs-on: ${{ matrix.runner }}
strategy:
matrix:
include:
- os: macos
runner: macos-latest
- os: windows
runner: windows-latest
- os: linux
runner: ubuntu-latest
fail-fast: false
environment: prod

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_VERSION }}
channel: "stable"
cache: true

- uses: webfactory/ssh-agent@v0.8.0
with:
ssh-private-key: ${{ secrets.SSH_KEY }}

- name: Setup
run: |
ssh-keyscan github.com >> ~/.ssh/known_hosts
flutter pub global activate flutter_distributor
shell: bash

- name: Setup Fastlane (macOS only)
uses: ruby/setup-ruby@v1
if: matrix.os == 'macos'
with:
ruby-version: ruby
bundler-cache: true
working-directory: ${{ matrix.os }}

- name: Build
env:
APPLE_CERTIFICATES_SSH_KEY: ${{ secrets.APPLE_CERTIFICATES_SSH_KEY }}
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
run: ./scripts/build-${{ matrix.os }}.sh
shell: bash

- name: Package
run: ./scripts/package-${{ matrix.os }}.sh
shell: bash

- name: Prepare files for release
env:
APPLE_KEY_ID: ${{ secrets.APPLE_KEY_ID }}
APPLE_ISSUER_ID: ${{ secrets.APPLE_ISSUER_ID }}
APPLE_KEY_CONTENT: ${{ secrets.APPLE_KEY_CONTENT }}
run: |
case "$RUNNER_OS" in
Linux)
cp dist/*/* "twake-$GITHUB_REF_NAME-linux-amd64.AppImage";;
macOS)
cp dist/*/* "twake-$GITHUB_REF_NAME-macos-amd64.dmg"
# Notarize the app
cd macos && bundle exec fastlane notarization
;;
Windows)
cp dist/*/* "twake-$GITHUB_REF_NAME-windows-amd64.exe";;
esac
shell: bash

- uses: actions/upload-artifact@v3
with:
name: twake-release
path: twake-${{ github.ref_name }}*

release_desktop:
name: Release on desktops
runs-on: ubuntu-latest
needs:
- package_desktop
environment: prod
permissions:
contents: write

steps:
- uses: actions/download-artifact@v3
with:
name: twake-release

- name: Calculate checksums
id: shasum
run: |
shasum -a 256 -b twake-$GITHUB_REF_NAME* > SHA256SUMS
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
echo "checksum<<$EOF" >> $GITHUB_OUTPUT
echo "$(cat SHA256SUMS)" >> $GITHUB_OUTPUT
echo "$EOF" >> $GITHUB_OUTPUT
- name: Release
uses: softprops/action-gh-release@v1
with:
body: |
See [CHANGELOG.md](https://github.com/tk-nguyen/twake-on-matrix/blob/${{ github.ref_name }}/CHANGELOG.md) for full changelogs.
### Checksums
```
${{ steps.shasum.outputs.checksum }}
```
files: |
twake-${{ github.ref_name }}*
SHA256SUMS
34 changes: 17 additions & 17 deletions ios/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,20 @@ GEM
artifactory (3.0.15)
atomos (0.1.3)
aws-eventstream (1.2.0)
aws-partitions (1.765.0)
aws-sdk-core (3.172.0)
aws-partitions (1.785.0)
aws-sdk-core (3.177.0)
aws-eventstream (~> 1, >= 1.0.2)
aws-partitions (~> 1, >= 1.651.0)
aws-sigv4 (~> 1.5)
jmespath (~> 1, >= 1.6.1)
aws-sdk-kms (1.64.0)
aws-sdk-core (~> 3, >= 3.165.0)
aws-sdk-kms (1.70.0)
aws-sdk-core (~> 3, >= 3.177.0)
aws-sigv4 (~> 1.1)
aws-sdk-s3 (1.122.0)
aws-sdk-core (~> 3, >= 3.165.0)
aws-sdk-s3 (1.128.0)
aws-sdk-core (~> 3, >= 3.177.0)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.4)
aws-sigv4 (1.5.2)
aws-sigv4 (~> 1.6)
aws-sigv4 (1.6.0)
aws-eventstream (~> 1, >= 1.0.2)
babosa (1.0.4)
claide (1.1.0)
Expand All @@ -30,13 +30,13 @@ GEM
commander (4.6.0)
highline (~> 2.0.0)
declarative (0.0.20)
digest-crc (0.6.4)
digest-crc (0.6.5)
rake (>= 12.0.0, < 14.0.0)
domain_name (0.5.20190701)
unf (>= 0.0.5, < 1.0.0)
dotenv (2.8.1)
emoji_regex (3.2.3)
excon (0.99.0)
excon (0.100.0)
faraday (1.10.3)
faraday-em_http (~> 1.0)
faraday-em_synchrony (~> 1.0)
Expand Down Expand Up @@ -65,8 +65,8 @@ GEM
faraday-retry (1.0.3)
faraday_middleware (1.2.0)
faraday (~> 1.0)
fastimage (2.2.6)
fastlane (2.212.2)
fastimage (2.2.7)
fastlane (2.213.0)
CFPropertyList (>= 2.3, < 4.0.0)
addressable (>= 2.8, < 3.0.0)
artifactory (~> 3.0)
Expand All @@ -90,7 +90,7 @@ GEM
json (< 3.0.0)
jwt (>= 2.1.0, < 3)
mini_magick (>= 4.9.4, < 5.0.0)
multipart-post (~> 2.0.0)
multipart-post (>= 2.0.0, < 3.0.0)
naturally (~> 2.2)
optparse (~> 0.1.1)
plist (>= 3.1.0, < 4.0.0)
Expand All @@ -106,7 +106,7 @@ GEM
xcpretty (~> 0.3.0)
xcpretty-travis-formatter (>= 0.0.3)
gh_inspector (1.1.3)
google-apis-androidpublisher_v3 (0.42.0)
google-apis-androidpublisher_v3 (0.45.0)
google-apis-core (>= 0.11.0, < 2.a)
google-apis-core (0.11.0)
addressable (~> 2.5, >= 2.5.1)
Expand Down Expand Up @@ -137,7 +137,7 @@ GEM
google-cloud-core (~> 1.6)
googleauth (>= 0.16.2, < 2.a)
mini_mime (~> 1.0)
googleauth (1.5.2)
googleauth (1.6.0)
faraday (>= 0.17.3, < 3.a)
jwt (>= 1.4, < 3.0)
memoist (~> 0.16)
Expand All @@ -150,12 +150,12 @@ GEM
httpclient (2.8.3)
jmespath (1.6.2)
json (2.6.3)
jwt (2.7.0)
jwt (2.7.1)
memoist (0.16.2)
mini_magick (4.12.0)
mini_mime (1.1.2)
multi_json (1.15.0)
multipart-post (2.0.0)
multipart-post (2.3.0)
nanaimo (0.3.0)
naturally (2.2.1)
optparse (0.1.1)
Expand Down
2 changes: 2 additions & 0 deletions ios/Runner/GoogleService-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
<string>492265884073-p6ssgrq23gkot2n5duiijl2t7b44777q.apps.googleusercontent.com</string>
<key>REVERSED_CLIENT_ID</key>
<string>com.googleusercontent.apps.492265884073-p6ssgrq23gkot2n5duiijl2t7b44777q</string>
<key>ANDROID_CLIENT_ID</key>
<string>492265884073-4s9mhnk9281tpitd9s9v35rc65iace3l.apps.googleusercontent.com</string>
<key>API_KEY</key>
<string>AIzaSyBQNqPIWurYEnpg8kfY2s9Gpt824B2MQEM</string>
<key>GCM_SENDER_ID</key>
Expand Down
21 changes: 21 additions & 0 deletions linux/packaging/appimage/make_config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
display_name: Twake

icon: assets/logo.png

keywords:
- Chat
- Messaging
- Network
- Social

generic_name: Twake

categories:
- Network
- Chat
- InstantMessaging

startup_notify: true

include:
- libolm.so.3
3 changes: 3 additions & 0 deletions macos/Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
source "https://rubygems.org"

gem "fastlane"
Loading

0 comments on commit 31042b9

Please sign in to comment.