Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade GitHub workflows #128

Merged
merged 18 commits into from
Jan 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
243 changes: 0 additions & 243 deletions .github/workflows/build-and-release.yml

This file was deleted.

66 changes: 66 additions & 0 deletions .github/workflows/build-linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Build Linux
on:
# Enable manual run
workflow_dispatch:
# Verify builds succeed on pull requests
pull_request:
# Allow being called by other workflows
workflow_call:
inputs:
pre-release:
description: "Whether the build is for a pre-release"
required: false
default: false
type: boolean

env:
app-display-name: "Nyrna"
author: "Merritt Codes"
identifier: "codes.merritt.Nyrna"

jobs:
build-linux:
name: Build Linux
runs-on: ubuntu-20.04

# ----------------------------------- Setup ------------------------------ #

steps:
- name: Setup Linux build requirements
run: |
sudo apt-get update
# libappindicator required for tray_manager
sudo apt-get install appindicator3-0.1 libappindicator3-dev
# keybinder required for global hotkeys
sudo apt-get install keybinder-3.0

- name: Set pre-release environment variable
if: inputs.pre-release == true
run: echo "prerelease=true" >> $GITHUB_ENV

- name: Setup Flutter
uses: subosito/flutter-action@v2.3.0

- name: Checkout code
uses: actions/checkout@v2

- name: Prepare for build
run: |
flutter config --enable-linux-desktop
flutter upgrade
flutter pub get

# ----------------------------------- Build ---------------------------- #

- name: Run build script
env:
GITHUB_TOKEN: ${{ secrets.RELEASES_TOKEN }}
run: flutter pub run flutter_app_builder --platforms=linux

# ---------------------------------- Upload ---------------------------- #

- name: Upload artifacts to workflow
uses: actions/upload-artifact@v2
with:
name: linux-artifacts
path: output/*
69 changes: 69 additions & 0 deletions .github/workflows/build-windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Build Windows
on:
# Enable manual run
workflow_dispatch:
# Verify builds succeed on pull requests
pull_request:
# Allow being called by other workflows
workflow_call:
inputs:
pre-release:
description: "Whether the build is for a pre-release"
required: false
default: false
type: boolean

env:
app-display-name: "Nyrna"
author: "Merritt Codes"
identifier: "codes.merritt.Nyrna"
msix-icon-path: "assets\\icons\\nyrna.png"

jobs:
build-windows:
name: Build Windows
runs-on: windows-2019

# ----------------------------------- Setup ------------------------------ #

steps:
- name: Set pre-release environment variable
if: inputs.pre-release == true
run: echo "prerelease=true" >> $GITHUB_ENV

- name: Setup Flutter
uses: subosito/flutter-action@v2.3.0

- name: Checkout code
uses: actions/checkout@v2

- name: Prepare for build
run: |
flutter config --enable-windows-desktop
flutter upgrade
flutter pub get

# ----------------------------------- Build ---------------------------- #

- name: Run build script
env:
GITHUB_TOKEN: ${{ secrets.RELEASES_TOKEN }}
run: flutter pub run flutter_app_builder -v --platforms=windows

# ---------------------------------- Upload ---------------------------- #

- name: Upload Windows Store MSIX artifact to workflow
uses: actions/upload-artifact@v2
with:
name: windows-store-artifact
path: output/*.msix

# MSIX is only for publishing to the Windows Store.
- name: Remove Windows Store artifact from release files
run: rm output/*.msix

- name: Upload artifacts to workflow
uses: actions/upload-artifact@v2
with:
name: windows-artifacts
path: output/*