Skip to content
This repository has been archived by the owner on Dec 28, 2024. It is now read-only.

Can't try to connect to two brokers at the same time and if on differ… #175

Can't try to connect to two brokers at the same time and if on differ…

Can't try to connect to two brokers at the same time and if on differ… #175

Workflow file for this run

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# If branch, build name will be the branch name and the date of the day
# Else if tag, build name will be tag name
# Create an apk of flutter sandbox application when creating a new tag, pushing
# on main branch or making a pull request. This apk will have a build name (the one
# a normal user can see) equal to the date of the day at the format year.month.day.hour
# if it comes from a push on main or a pull request, if the actions come from pushing of
# a tag then it will simply take the name of the tag (tag name must respect format precise
# in the specs : content/docs/sandbox-app/specifications/naming_rules/index.md)
name: Build Binaries
on:
push:
branches: [ "main" ]
tags:
- '*'
pull_request:
branches: [ "main" ]
jobs:
build_apk:
runs-on: ubuntu-latest
steps:
- name: Get tag name
id: tag_name
run: echo "name=$(echo $GITHUB_REF | cut -d / -f 3)" >> $GITHUB_ENV
- name: Get current date
id: date
run: echo "today=$(date +'%Y.%m.%d.%H')" >> $GITHUB_ENV
- name: Clone repository
uses: actions/checkout@v4
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: 3.19.0
- run: flutter clean
- run: flutter pub get
- run: flutter pub run flutter_launcher_icons
# If build from tag will use the tag name like build name with these 2 steps
- name: build apk with tag
if: startsWith(github.ref, 'refs/tags/')
run: flutter build apk --build-name ${{ env.name }}
- name: build appbundle with tag
if: startsWith(github.ref, 'refs/tags/')
run: flutter build appbundle --build-name ${{ env.name }}
- name: change apk name with tag name
if: startsWith(github.ref, 'refs/tags/')
run: mv build/app/outputs/flutter-apk/app-release.apk build/app/outputs/flutter-apk/${{env.name}}.apk
- name: Upload APK
if: startsWith(github.ref, 'refs/tags/')
uses: actions/upload-artifact@v4
with:
name: apk
path: build/app/outputs/flutter-apk/${{env.name}}.apk
# If build from branch will use the date of the day at the format year.month.day.hour
# like build name with these two next steps
- name: build apk with branch
if: (!startsWith(github.ref, 'refs/tags/'))
run: flutter build apk --build-name ${{ env.today }}
- name: build apk with branch
if: (!startsWith(github.ref, 'refs/tags/'))
run: flutter build appbundle --build-name ${{ env.today }}
- name: change apk name with branch
if: (!startsWith(github.ref, 'refs/tags/'))
run: mv build/app/outputs/flutter-apk/app-release.apk build/app/outputs/flutter-apk/${{env.today}}.apk
- name: Upload APK
if: (!startsWith(github.ref, 'refs/tags/'))
uses: actions/upload-artifact@v4
with:
name: apk
path: build/app/outputs/flutter-apk/${{env.today}}.apk
# build and upload windows app with default name
build_windows_app:
runs-on: windows-latest
steps:
# Get flutter and setup
- name: Clone repository
uses: actions/checkout@v4
- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: 3.19.0
- run: flutter clean
- run: flutter pub get
- run: flutter pub run flutter_launcher_icons
# Build windows app + upload
- name: build windows app
run: flutter build windows
- name: Upload windows app
uses: actions/upload-artifact@v4
with:
name: windows_app
path: build\windows\x64\runner\Release