Skip to content

Publish Release

Publish Release #9

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 }}