Skip to content

Commit

Permalink
Add Linux and Web release artifacts
Browse files Browse the repository at this point in the history
  • Loading branch information
cachapa committed Apr 22, 2024
1 parent 58d3549 commit 24d0434
Show file tree
Hide file tree
Showing 9 changed files with 141 additions and 30 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Release Android
name: Android
on:
workflow_call:
inputs:
Expand Down Expand Up @@ -56,6 +56,12 @@ jobs:
flutter build appbundle --build-number $BUILD_NUMBER --build-name $BUILD_NAME
flutter build apk --build-number $BUILD_NUMBER --build-name $BUILD_NAME
- name: Rename build artifacts
working-directory: build/app/outputs/bundle/release
run: |
mv app-release.aab tudo_android.aab
mv app-release.apk tudo_android.apk
- uses: ruby/setup-ruby@v1
with:
working-directory: android
Expand All @@ -67,12 +73,10 @@ jobs:
lane: 'deploy'
subdirectory: 'android'

- name: Create release
uses: softprops/action-gh-release@v1
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
tag_name: ${{ inputs.name }}
name: "tudo ${{ inputs.name }}"
generate_release_notes: true
files: |
build/app/outputs/bundle/release/app-release.aab
build/app/outputs/apk/release/app-release.apk
name: android
path: |
build/app/outputs/bundle/release/tudo_android.aab
build/app/outputs/apk/release/tudo_android.apk
10 changes: 8 additions & 2 deletions .github/workflows/release_ios.yml → .github/workflows/ios.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Release iOS
name: iOS
on:
workflow_call:
inputs:
Expand Down Expand Up @@ -48,4 +48,10 @@ jobs:
env:
APP_STORE_CONNECT_USERNAME: ${{ secrets.APP_STORE_CONNECT_USERNAME }}
APP_STORE_CONNECT_PASSWORD: ${{ secrets.APP_STORE_CONNECT_PASSWORD }}
run: xcrun altool --upload-app -t ios -f "build/ios/ipa/tudo.ipa" -u "$APP_STORE_CONNECT_USERNAME" -p "$APP_STORE_CONNECT_PASSWORD"
run: xcrun altool --upload-app -t ios -f "build/ios/ipa/tudo_ios.ipa" -u "$APP_STORE_CONNECT_USERNAME" -p "$APP_STORE_CONNECT_PASSWORD"

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ios
path: build/ios/ipa/tudo_ios.ipa
39 changes: 39 additions & 0 deletions .github/workflows/linux_x86_64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Linux x86-64
on:
workflow_call:
inputs:
name:
required: true
type: string

jobs:
build:
timeout-minutes: 30
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Load config
run: echo "${{ secrets.CONFIG }}" > lib/config.dart

- uses: subosito/flutter-action@v2
with:
cache: true

- name: Install dev tools
run: sudo apt-get install ninja-build build-essential libgtk-3-0 libgtk-3-dev libblkid1 liblzma5

- name: Build app
run: flutter build linux

- name: Create archive
working-directory: build/linux/x64/release/bundle
run: tar -acf tudo_linux_x86_64.tar.gz *

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: linux_x86_64
path: build/linux/x64/release/bundle/tudo_linux_x86_64.tar.gz
File renamed without changes.
60 changes: 43 additions & 17 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
name: Release
on:
workflow_dispatch:
inputs:
android:
description: 'Android'
default: 'true'
type: boolean
ios:
description: 'iOS'
default: 'true'
type: boolean
on: workflow_dispatch

permissions:
contents: write
Expand Down Expand Up @@ -75,22 +65,58 @@ jobs:
echo EOF
} >> "$GITHUB_OUTPUT"
Android:
if: inputs.android
uses: ./.github/workflows/release_android.yml
android:
name: Android
uses: ./.github/workflows/android.yml
needs: version
secrets: inherit
with:
name: "${{ needs.version.outputs.name }}"
number: "${{ needs.version.outputs.number }}"
changelog: "${{ needs.version.outputs.changelog }}"

iOS:
if: inputs.ios
uses: ./.github/workflows/release_ios.yml
ios:
name: iOS
uses: ./.github/workflows/ios.yml
needs: version
secrets: inherit
with:
name: "${{ needs.version.outputs.name }}"
number: "${{ needs.version.outputs.number }}"
changelog: "${{ needs.version.outputs.changelog }}"

linux_x86_64:
name: Linux x86-64
uses: ./.github/workflows/linux_x86_64.yml
needs: version
secrets: inherit
with:
name: "${{ needs.version.outputs.name }}"

web:
name: Web
uses: ./.github/workflows/web.yml
needs: version
secrets: inherit
with:
name: "${{ needs.version.outputs.name }}"

create_release:
name: Create release
runs-on: ubuntu-latest
needs: [ version, android, ios, linux_x86_64, web ]
steps:
- name: Download all workflow run artifacts
uses: actions/download-artifact@v4

- uses: softprops/action-gh-release@v1
with:
tag_name: ${{ needs.version.outputs.name }}
name: "tudo ${{ needs.version.outputs.name }}"
generate_release_notes: true
files: |
android/bundle/release/tudo_android.aab
android/apk/release/tudo_android.apk
ios/tudo_ios.ipa
linux_x86_64/tudo_linux_x86_64.tar.gz
web/tudo_web.zip
36 changes: 36 additions & 0 deletions .github/workflows/web.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Web
on:
workflow_call:
inputs:
name:
required: true
type: string

jobs:
build:
timeout-minutes: 30
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Load config
run: echo "${{ secrets.CONFIG }}" > lib/config.dart

- uses: subosito/flutter-action@v2
with:
cache: true

- name: Build app
run: flutter build web

- name: Create archive
working-directory: build/web
run: zip tudo_web.zip *

- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: web
path: build/web/tudo_web.zip
2 changes: 1 addition & 1 deletion android/fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ platform :android do
upload_to_play_store(
track: "internal",
rollout: "1",
aab: "../build/app/outputs/bundle/release/app-release.aab",
aab: "../build/app/outputs/bundle/release/tudo_android.aab",
mapping: "../build/app/outputs/mapping/release/mapping.txt"
)
end
Expand Down
1 change: 1 addition & 0 deletions lib/settings/settings_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ class SettingsPage extends StatelessWidget {
final path =
'${(await getApplicationCacheDirectory()).path}/tudo_account_key.png';
await File(path).writeAsBytes(pngBytes, flush: true);
if (!context.mounted) return;
await Share.shareXFiles(
[XFile(path)],
subject: context.t.tudoAccountKey,
Expand Down
1 change: 0 additions & 1 deletion lib/util/update_util.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import 'package:in_app_update/in_app_update.dart';
import 'package:url_launcher/url_launcher_string.dart';

import '../registry.dart';
import 'build_info.dart';

class UpdateUtil {
static final Future<bool> updateAvailable = Platform.isAndroid
Expand Down

0 comments on commit 24d0434

Please sign in to comment.