feat: 更新版本号获取方式 #11
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 构建 MacOS 应用 | |
on: | |
push: | |
tags: | |
- 'v*' | |
# workflow_dispatch: | |
# inputs: | |
# tag: | |
# description: 'Version tag' | |
# required: true | |
# default: '0.0.1' | |
jobs: | |
main: | |
name: Release MacOS App | |
runs-on: macos-latest | |
steps: | |
- name: 克隆仓库 | |
uses: actions/checkout@v4 | |
- name: 安装 Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
channel: stable | |
cache: true | |
- run: flutter build macos | |
- name: 安装 create-image | |
uses: actions/checkout@v2 | |
with: | |
repository: create-dmg/create-dmg | |
path: ./build/create-dmg | |
ref: master | |
- name: 打包为 DMG | |
shell: bash | |
working-directory: ./build | |
run: | | |
./create-dmg/create-dmg \ | |
--volname bbmusic \ | |
--window-size 400 200 \ | |
--icon-size 100 \ | |
--icon bbmusic 30 70 \ | |
--app-drop-link 200 70 \ | |
build/bbmusic.dmg \ | |
build/macos/Build/Products/Release/bbmusic.app | |
- name: 推送到 release | |
uses: softprops/action-gh-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
files: ./build/bbmusic.dmg | |
token: ${{ secrets.GITHUB_TOKEN }} |