Skip to content

Commit f1f237f

Browse files
committed
👷 增加 CI
1 parent 790f05e commit f1f237f

File tree

3 files changed

+83
-1
lines changed

3 files changed

+83
-1
lines changed

.github/workflows/flutter.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: Flutter CI
2+
3+
# This workflow is triggered on pushes to the repository.
4+
5+
on:
6+
push:
7+
branches:
8+
- master
9+
10+
jobs:
11+
build:
12+
# This job will run on macos virtual machine
13+
runs-on: macos-13
14+
steps:
15+
16+
# Setup Java environment in order to build the Android app.
17+
- uses: actions/checkout@v3
18+
- uses: actions/setup-java@v3
19+
with:
20+
distribution: 'temurin'
21+
java-version: '11'
22+
cache: 'gradle'
23+
# Setup the flutter environment.
24+
- uses: subosito/flutter-action@v2
25+
with:
26+
channel: 'stable' # 'dev', 'alpha', default to: 'stable'
27+
# flutter-version: '1.22.x' # you can also specify exact version of flutter
28+
29+
# Get flutter dependencies.
30+
- run: flutter pub get
31+
32+
# Check for any formatting issues in the code.
33+
- run: dart format --set-exit-if-changed .
34+
35+
# Statically analyze the Dart code for any errors.
36+
- run: dart analyze .
37+
38+
#####
39+
# Build app
40+
#####
41+
# Build apk.
42+
- run: cd example && flutter build apk
43+
# Build ios
44+
- run: cd example && flutter build ios --no-codesign

.github/workflows/release.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*.*.*'
7+
8+
jobs:
9+
create_release:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout repository
13+
uses: actions/checkout@v4
14+
15+
- name: Extract version from tag
16+
id: extract_version
17+
run: |
18+
VERSION=${GITHUB_REF#refs/tags/v}
19+
echo "VERSION=$VERSION" >> $GITHUB_ENV
20+
21+
- name: Read release notes
22+
id: release_notes
23+
run: |
24+
VERSION=${{ env.VERSION }}
25+
CHANGELOG=$(sed -n "/## $VERSION/,/^## /p" CHANGELOG.md | sed '$d' | tail -n +2)
26+
if [ -z "$CHANGELOG" ]; then
27+
echo "Release notes not found for version $VERSION"
28+
exit 1
29+
fi
30+
echo "RELEASE_NOTES<<EOF" >> $GITHUB_ENV
31+
echo "$CHANGELOG" >> $GITHUB_ENV
32+
echo "EOF" >> $GITHUB_ENV
33+
34+
- name: Create GitHub release
35+
uses: softprops/action-gh-release@v2
36+
with:
37+
body: ${{ env.RELEASE_NOTES }}
38+
env:
39+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

CHANGELOG.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
## 1.0.0
2-
32
* 🚀 [仅提供 Pro 版本](https://flutterads.top/)
43
* 🎉 【独家支持】可 Widget 组件嵌入Flutter 页面
54
* 🎨 【独家支持】可自定义 UI 样式,与业务完美契合

0 commit comments

Comments
 (0)