Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev #104

Merged
merged 18 commits into from
Jan 17, 2025
Merged

Dev #104

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name-template: 'v$NEXT_PATCH_VERSION'
tag-template: 'v$NEXT_PATCH_VERSION'
categories:
- title: ✨ Features
labels:
- feat
- title: 🐛 Bug Fixes
labels:
- fix
- title: 🛠️ Chores
labels:
- chore
- title: 🏗️ Build System
labels:
- build
- title: ⚡ Performance Improvements
labels:
- perf
- title: 🔨 Refactors
labels:
- refactor
- title: 🎨 Code Style Updates
labels:
- style

change-template: '- $TITLE (#$NUMBER) by @$AUTHOR'
template: |
# 📦 $RELEASE_TITLE

## 🔥 What is New
Here's what's changed and improved in this release:

$CHANGES

## 📋 Categories
$CATEGORY_RELEASES

---
🕒 Release Date: $DATE
🔖 Compare Changes: [View Changes](https://github.com/$REPOSITORY/compare/$PREVIOUS_TAG...$TAG)
105 changes: 11 additions & 94 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,132 +47,49 @@ jobs:
name: android-apk
path: build/app/outputs/flutter-apk/app-release.apk

# build-msix:
# runs-on: windows-latest
# name: Build MSIX
# needs: build-apk
#
# steps:
# - name: Checkout Repository
# uses: actions/checkout@v3
#
# - name: Set Up Flutter
# uses: subosito/flutter-action@v2
# with:
# flutter-version: '3.27.1'
#
# - name: Install Dependencies
# run: flutter pub get
#
# - name: Build MSIX
# run: flutter build windows --release
#
# - name: Upload MSIX Artifact
# uses: actions/upload-artifact@v3
# with:
# name: windows-msix
# path: build/windows/runner/Release/*.msix

# build-ios-macos:
# runs-on: macos-latest
# name: Build iOS & macOS
# needs: build-apk
#
# steps:
# - name: Checkout Repository
# uses: actions/checkout@v3
#
# - name: Set Up Flutter
# uses: subosito/flutter-action@v2
# with:
# flutter-version: '3.27.0-0.2.pre'
#
# - name: Install Dependencies
# run: flutter pub get
#
# - name: Set Up Certificates and Profiles
# run: |
# echo "${{ secrets.CERTIFICATE }}" | base64 --decode > signing_certificate.p12
# echo "${{ secrets.PROFILE }}" | base64 --decode > provisioning_profile.mobileprovision
#
# - name: Build iOS
# run: flutter build ipa --release
#
# - name: Build macOS
# run: flutter build macos --release
#
# - name: Upload iOS Artifact
# uses: actions/upload-artifact@v3
# with:
# name: ios-ipa
# path: build/ios/ipa/*.ipa
#
# - name: Upload macOS Artifact
# uses: actions/upload-artifact@v3
# with:
# name: macos-app
# path: build/macos/Build/Products/Release/*.app

release:
runs-on: ubuntu-latest
name: Publish Release
needs: [ build-apk ]

steps:

- name: Checkout Repository
uses: actions/checkout@v3

# 下载构建产物
- name: Download APK Artifact
uses: actions/download-artifact@v3
with:
name: android-apk
path: artifacts/android

# - name: Download MSIX Artifact
# uses: actions/download-artifact@v3
# with:
# name: windows-msix
# path: artifacts/windows

# - name: Download iOS Artifact
# uses: actions/download-artifact@v3
# with:
# name: ios-ipa
# path: artifacts/ios
#
# - name: Download macOS Artifact
# uses: actions/download-artifact@v3
# with:
# name: macos-app
# path: artifacts/macos

# 提取版本号
- name: Extract Version
id: extract_version
run: |
version=$(grep '^version: ' pubspec.yaml | cut -d ' ' -f 2 | tr -d '\r')
version=$(awk '/^version: / {print $2}' pubspec.yaml | tr -d '\r')
echo "VERSION=$version" >> $GITHUB_ENV

# 重命名构建产物

- name: Rename Artifacts
run: |
mkdir -p renamed-artifacts
mv artifacts/android/app-release.apk renamed-artifacts/moodiary-${{ env.VERSION }}-android-arm64.apk
# mv artifacts/windows/*.msix renamed-artifacts/moodiary-${{ env.VERSION }}-windows-x64.msix
# mv artifacts/ios/*.ipa renamed-artifacts/moodiary-${{ env.VERSION }}-ios.ipa
# mv artifacts/macos/*.app renamed-artifacts/moodiary-${{ env.VERSION }}-macos.app

# 生成 Release Notes
- name: Generate Release Notes
id: release_notes
uses: release-drafter/release-drafter@v5
with:
config-name: release-drafter.yml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# 发布 Release
- name: Create Release
uses: ncipollo/release-action@v1
with:
artifacts: renamed-artifacts/*
tag: v${{ env.VERSION }}
tag: v${{ env.VERSION }}
name: Release v${{ env.VERSION }}
body: ${{ steps.release_notes.outputs.notes }}
draft: true
prerelease: false
token: ${{ secrets.GITHUB_TOKEN }}
83 changes: 0 additions & 83 deletions .github/workflows/main.yml

This file was deleted.

Loading