-
-
Notifications
You must be signed in to change notification settings - Fork 3
117 lines (98 loc) · 3.91 KB
/
publish_release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
name: Publish Release
on:
workflow_dispatch:
inputs:
release_tag:
description: 'Release tag (e.g., v1.0.0)'
required: true
release_name:
description: 'Release name'
required: true
release_notes:
description: 'Release Notes'
required: true
jobs:
build-and-release:
name: Build and Release
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
env:
RELEASE_NOTES: |
**Notice:** By downloading and using the pre-built binaries, you agree to the app's [Terms and Conditions](https://github.com/1runeberg/confichat/blob/main/confichat/assets/TERMS_AND_CONDITIONS.md). Acceptance of these terms is implied upon download. The full Terms and Conditions are also available within the app under (Hamburger menu) > "Legal" > "Terms and Conditions".
${{ github.event.inputs.release_notes }}
steps:
- uses: actions/[email protected]
- name: Set up Java
uses: actions/[email protected]
with:
distribution: 'zulu'
java-version: '17'
- name: Set up Flutter
uses: subosito/[email protected]
with:
channel: 'stable'
- name: Install dependencies
run: cd confichat && flutter pub get
- name: Update third party licenses window
run: cd confichat && flutter pub run flutter_oss_licenses:generate.dart
- name: Build Windows App
if: matrix.os == 'windows-latest'
run: cd confichat && flutter build windows --release
- name: Archive Windows Build
if: matrix.os == 'windows-latest'
run: |
Compress-Archive -Path confichat/build/windows/x64/runner/Release/* -DestinationPath confichat/build/windows/x64/runner/Release/windows-release.zip
shell: pwsh
- name: Build Linux App
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update -y
sudo apt-get install -y ninja-build libgtk-3-dev
cd confichat
flutter config --enable-linux-desktop
flutter build linux --release
- name: Archive Linux Build
if: matrix.os == 'ubuntu-latest'
run: |
cd confichat/build/linux/x64/release/bundle
tar -czvf linux-release.tgz *
- name: Build Android App
if: matrix.os == 'ubuntu-latest'
run: cd confichat && flutter build apk --release
- name: Archive Android Build
if: matrix.os == 'ubuntu-latest'
run: |
cd confichat/build/app/outputs/flutter-apk
zip -r android-release.zip app-release.apk
- name: Create Release (Windows)
if: matrix.os == 'windows-latest'
uses: softprops/[email protected]
with:
tag_name: ${{ github.event.inputs.release_tag }}
name: ${{ github.event.inputs.release_name }}
body: ${{ env.RELEASE_NOTES }}
files: confichat/build/windows/x64/runner/Release/windows-release.zip
env:
GITHUB_TOKEN: ${{ secrets.CONFICHAT_SECRET }}
- name: Create Release (Linux)
if: matrix.os == 'ubuntu-latest'
uses: softprops/[email protected]
with:
tag_name: ${{ github.event.inputs.release_tag }}
name: ${{ github.event.inputs.release_name }}
body: ${{ env.RELEASE_NOTES }}
files: confichat/build/linux/x64/release/bundle/linux-release.tgz
env:
GITHUB_TOKEN: ${{ secrets.CONFICHAT_SECRET }}
- name: Create Release (Android)
if: matrix.os == 'ubuntu-latest'
uses: softprops/[email protected]
with:
tag_name: ${{ github.event.inputs.release_tag }}
name: ${{ github.event.inputs.release_name }}
body: ${{ env.RELEASE_NOTES }}
files: confichat/build/app/outputs/flutter-apk/android-release.zip
env:
GITHUB_TOKEN: ${{ secrets.CONFICHAT_SECRET }}