Skip to content

Commit

Permalink
Create release.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
iris1598 committed Sep 3, 2024
1 parent ecc7384 commit 9cff41f
Showing 1 changed file with 68 additions and 0 deletions.
68 changes: 68 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# This is a basic workflow to help you get started with Actions

name: Release CI

on:
push:
tags:
- v*

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
generate-changelog:
# needs: ["build-and-release-android", "build-and-release-windows"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
ref: main
- uses: actions/setup-node@v3
with:
node-version: 16.x
- run: npx changelogithub
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

build-and-release-windows:
runs-on: windows-latest

steps:
- uses: actions/checkout@v3
with:
ref: main
- uses: subosito/flutter-action@v2
with:
flutter-version: 3.16.8
channel: stable
- name: Install project dependencies
run: flutter pub get
- name: Build artifacts
run: flutter build windows --release -v
- name: Build Installer
run: iex ("& {0} {1} {2}" -f '"C:\Program Files (x86)\Inno Setup 6\iscc.exe"',"/DMyAppVersion='${{github.ref_name}}'", ".\inno_setup.iss")
- name: Archive Release
uses: thedoctor0/zip-release@master
with:
type: "zip"
filename: Miru-${{github.ref_name}}-windows.zip
directory: build/windows/x64/runner/Release
- name: Rename Release Directory Name to Miru-App # For Artifacts.
# 但是此处将压缩出来的包迁移到了一个临时 temp 目录,这是用来上传到 Release Assets 的
# 再下面的重命名是为了 Artifacts 的
run: |
mkdir temp
mv build/windows/x64/runner/Release/Miru-${{github.ref_name}}-windows.zip temp/Miru-${{github.ref_name}}-windows.zip
mv build/windows/x64/runner/Release build/windows/x64/runner/Miru-App
# 发布安装包
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
path: "build/windows/x64/runner/Miru-App"
name: Miru-pr-${{ github.event.pull_request.number }}-windows.zip
- name: Release Packages
uses: ncipollo/release-action@v1
with:
artifacts: "temp/Miru-${{github.ref_name}}-windows.zip,Output/*.exe"
allowUpdates: true
omitBody: true

0 comments on commit 9cff41f

Please sign in to comment.