Skip to content

Commit

Permalink
feat: add github settings
Browse files Browse the repository at this point in the history
  • Loading branch information
asjqkkkk committed Jun 21, 2024
1 parent 65e7c78 commit f9ee93e
Show file tree
Hide file tree
Showing 5 changed files with 246 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: bug
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Environment(please complete the following information):**
Please use `flutter doctor -v` to show your flutter environment, and add your `markdown_widget` version too

**Platform**
Does the problem appear on the **Web** or on the **Mobile**

**Source data**
Please provide a minimal source data that can help locating the problem
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: enhancement
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
105 changes: 105 additions & 0 deletions .github/workflows/build_releases.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
name: Flutter CI

on:
push:
branches:
- main

jobs:
build-and-release-linux:
runs-on: ubuntu-22.04
if: startsWith(github.ref, 'refs/tags/')

steps:
- uses: actions/checkout@v2
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
architecture: x64
flutter-version: '3.16.5'
- name: Install dependencies
run: sudo apt-get install -y clang cmake ninja-build pkg-config libgtk-3-0 libgtk-3-dev libblkid1 liblzma5
- name: Install project dependencies
run: flutter pub get
- name: Generate intermediates
run: flutter pub run build_runner build --delete-conflicting-outputs
- name: Enable linux build
run: flutter config --enable-linux-desktop
- name: Build artifacts
run: flutter build linux --release
- name: Archive Release
uses: thedoctor0/zip-release@master
with:
type: 'zip'
filename: markdown-${{github.ref_name}}-linux.zip
directory: build/linux/x64/release/bundle
- name: Linux Release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.ACTION_TOKEN }}
with:
files: build/linux/x64/release/bundle/markdown-${{github.ref_name}}-linux.zip

build-and-release-windows:
runs-on: windows-latest
if: startsWith(github.ref, 'refs/tags/')

steps:
- uses: actions/checkout@v2
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
architecture: x64
flutter-version: '3.16.5'
- name: Install project dependencies
run: flutter pub get
- name: Generate intermediates
run: flutter pub run build_runner build --delete-conflicting-outputs
- name: Enable windows build
run: flutter config --enable-windows-desktop
- name: Build artifacts
run: flutter build windows --release
- name: Archive Release
uses: thedoctor0/zip-release@master
with:
type: 'zip'
filename: markdown-${{github.ref_name}}-windows.zip
directory: build/windows/runner/Release
- name: Windows Release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.ACTION_TOKEN }}
with:
files: build/windows/runner/Release/markdown-${{github.ref_name}}-windows.zip

build-and-release-macos:
runs-on: macos-latest
if: startsWith(github.ref, 'refs/tags/')

steps:
- uses: actions/checkout@v2
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
architecture: x64
flutter-version: '3.16.5'
- name: Install project dependencies
run: flutter pub get
- name: Generate intermediates
run: flutter pub run build_runner build --delete-conflicting-outputs
- name: Enable macOS build
run: flutter config --enable-macos-desktop
- name: Build artifacts
run: flutter build macos --release
- name: Archive Release
uses: thedoctor0/zip-release@master
with:
type: 'zip'
filename: markdown-${{github.ref_name}}-macos.zip
directory: build/macos/Build/Products/Release
- name: macOS Release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.ACTION_TOKEN }}
with:
files: build/macos/Build/Products/Release/markdown-${{github.ref_name}}-macos.zip
65 changes: 65 additions & 0 deletions .github/workflows/build_web.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Build & deploy

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build:
name: Build
runs-on: ubuntu-latest

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

- name: Install Flutter
uses: subosito/flutter-action@v1
with:
channel: 'stable'
flutter-version: '3.16.5'


- name: Get dependencies
run: flutter pub get

- name: Test project
run: flutter test

- name: Build release project
run: flutter build web

- name: Show dir
run: ls && cd example && ls

- name: Download medias
run: dart run build_script/script_convert_asset.dart

- name: Upload production-ready build files
uses: actions/upload-artifact@v2
with:
name: production-files
path: build/web

deploy:
name: Deploy
needs: build
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/dev'

steps:
- name: Download artifact
uses: actions/download-artifact@v2
with:
name: production-files
path: build/web

- name: Deploy to gh-pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.ACTION_TOKEN }}
publish_dir: build/web
23 changes: 23 additions & 0 deletions .github/workflows/coverage_action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Test Coveralls

on:
push:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: subosito/flutter-action@v1
with:
channel: 'stable'
flutter-version: '3.16.5'
- run: flutter pub get
- run: flutter packages pub run build_runner build
- run: flutter test --coverage ./test/
- uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: coverage/lcov.info

0 comments on commit f9ee93e

Please sign in to comment.