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

ci: add Github Action workflows #30

Merged
merged 1 commit into from
Apr 26, 2024
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Build release tag
on:
push:
tags:
- "v*"
workflow_dispatch:

jobs:
build:
name: Create ${{ matrix.os }} build
runs-on: ${{ matrix.os }}
strategy:
matrix:
target: [Linux]
include:
- os: ubuntu-latest
target: Linux
build_target: linux
build_path: build/linux/x64/release/bundle
asset_name: linux_amd64
asset_extension: .tar.gz
asset_content_type: application/gzip
fail-fast: false
steps:
- name: Install Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
flutter-version-flie: pubspec.yaml
- name: Install Linux dependencies
if: matrix.target == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y clang cmake ninja-build libgtk-3-dev libstdc++-12-dev
- uses: actions/checkout@v2
- run: |
flutter config --enable-linux-desktop
flutter config --no-analytics
dart --disable-analytics
flutter config --no-enable-android
flutter config --no-enable-web
- run: flutter doctor -v
- run: flutter pub get
- run: dart fix --apply --code=unnecessary_final
- run: flutter build -v ${{ matrix.build_target }} --release
- name: Compress build for Linux
if: matrix.target == 'Linux'
run: tar czf $GITHUB_WORKSPACE/yatta_${{ matrix.build_target }}${{ matrix.asset_extension }} *
working-directory: ${{ matrix.build_path }}
- name: Upload the artifact to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
release_name: Release ${{ github.ref_name }}
file: yatta_${{ matrix.build_target }}${{ matrix.asset_extension }}
tag: ${{ github.ref }}
asset_name: yatta_${{ github.ref_name }}_${{ matrix.asset_name }}${{ matrix.asset_extension }}
overwrite: true
33 changes: 33 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Code check

on:
push:
branches:
- main
pull_request:
types:
- opened
- reopened
- synchronize

jobs:
format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: subosito/flutter-action@v2
with:
channel: stable
flutter-version-flie: pubspec.yaml
- name: Update dependencies
run: flutter pub get
- name: Disable analytics
run: |
flutter config --no-analytics
dart --disable-analytics
- name: Remove custom lint # https://github.com/invertase/dart_custom_lint/issues/228
run: sed -i '/custom_lint/d' analysis_options.yaml
- name: Format
run: dart format --set-exit-if-changed lib
- name: Analyze
run: flutter analyze lib
2 changes: 1 addition & 1 deletion pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -890,4 +890,4 @@ packages:
version: "1.0.3"
sdks:
dart: ">=3.3.3 <4.0.0"
flutter: ">=3.19.0"
flutter: ">=3.19.6"
7 changes: 4 additions & 3 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ description: A multipurpose YouTube frontend for hackers

publish_to: "none"

version: 0.0.0
version: 0.0.2

environment:
sdk: ">=3.0.0 <4.0.0"
flutter: 3.19.6

dependencies:
autoscroll:
Expand All @@ -21,11 +22,11 @@ dependencies:
path: package/youtube_api/

dev_dependencies:
custom_lint:
custom_lint: ^0.6.4
extra_pedantic: ^4.0.0
flutter_test:
sdk: flutter
riverpod_lint:
riverpod_lint: ^2.3.10
test: ^1.21.0

flutter:
Expand Down
Loading