-
Notifications
You must be signed in to change notification settings - Fork 1
100 lines (98 loc) · 3.02 KB
/
release.yml
File metadata and controls
100 lines (98 loc) · 3.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
name: "release"
on:
push:
tags:
- v*
jobs:
changelog:
runs-on: ubuntu-latest
outputs:
changes: ${{ steps.changelog_reader.outputs.changes }}
version: ${{ steps.get_version.outputs.VERSION }}
steps:
- uses: actions/checkout@v4
- name: Get Version number
id: get_version
run: |
VERSION=$(yq eval -r '.version' pubspec.yaml)
echo $VERSION
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
- name: Changelog Reader
id: changelog_reader
uses: mindsers/changelog-reader-action@v2
with:
path: "CHANGELOG.md"
version: ${{ steps.get_version.outputs.VERSION }}
build:
name: Build releases
runs-on: macos-26
needs: changelog
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
flutter-version: 3.x
- name: Install Dependencies
run: flutter pub get
- name: Install create-dmg
run: brew install create-dmg
- name: Enable macOS Support
run: flutter config --enable-macos-desktop
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
target: x86_64-apple-darwin, aarch64-apple-darwin
- name: Build releases
run: chmod +x build_releases.sh && ./build_releases.sh
- name: Package arm64 as DMG
run: |
create-dmg \
--volname "Shell Assistant" \
--background "pic/bg.svg" \
--window-pos 400 200 \
--window-size 660 400 \
--icon-size 100 \
--icon "Shell Assistant.app" 160 185 \
--hide-extension "Shell Assistant.app" \
--app-drop-link 500 185 \
"release/dmgs/Shell Assistant-arm64.dmg" \
"release/arm/Shell Assistant.app"
- name: Package x86_64 as DMG
run: |
create-dmg \
--volname "Shell Assistant" \
--background "pic/bg.svg" \
--window-pos 400 200 \
--window-size 660 400 \
--icon-size 100 \
--icon "Shell Assistant.app" 160 185 \
--hide-extension "Shell Assistant.app" \
--app-drop-link 500 185 \
"release/dmgs/Shell Assistant-x86_64.dmg" \
"release/x86/Shell Assistant.app"
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: macOS-dmgs
path: release/dmgs
release:
name: Create Release
needs: [changelog, build]
runs-on: ubuntu-latest
steps:
- name: Download macOS DMG
uses: actions/download-artifact@v4
with:
name: macOS-dmgs
path: dmgs
- name: Publish Release
uses: softprops/action-gh-release@v2
with:
body: ${{ needs.changelog.outputs.changes }}
token: ${{ secrets.GITHUB_TOKEN }}
files: dmgs/*.dmg
draft: true