Skip to content

git: temporary fix for building macos build #38

git: temporary fix for building macos build

git: temporary fix for building macos build #38

Workflow file for this run

name: Build and Release AnymeX
on:
push:
tags:
- "v*"
workflow_dispatch:
jobs:
generate-changelog:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Generate Changelog
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
#!/bin/bash
PREVIOUS_TAG=$(git tag --sort=-v:refname | grep -vE '(-alpha|-beta|-rc)' | head -n 2 | tail -n 1)
CURRENT_TAG=${GITHUB_REF#refs/tags/}
if [ -z "$PREVIOUS_TAG" ]; then
PREVIOUS_TAG=$(git rev-list --max-parents=0 HEAD)
fi
# Initialize changelog with the current tag as the version
echo "# Changelog" > CHANGELOG.md
echo "## $CURRENT_TAG" >> CHANGELOG.md
echo "" >> CHANGELOG.md
# 🎉 New Features: (commits with 'feat')
echo "## 🎉 New Features:" >> CHANGELOG.md
git log $PREVIOUS_TAG..$CURRENT_TAG --grep='^feat' --pretty=format:'* [`%h`](https://github.com/RyanYuuki/AnymeX/commit/%h): %s' >> CHANGELOG.md
echo "" >> CHANGELOG.md
# 🛠️ Bug Fixes & Improvements: (commits with 'fix', 'bug', 'improvement', etc.)
echo "## 🛠️ Bug Fixes & Improvements:" >> CHANGELOG.md
git log $PREVIOUS_TAG..$CURRENT_TAG --grep='^(fix|bug|improvement|patch)' --pretty=format:'* [`%h`](https://github.com/RyanYuuki/AnymeX/commit/%h): %s' >> CHANGELOG.md
echo "" >> CHANGELOG.md
# 🔧 Refactors: (commits with 'refactor')
echo "## 🔧 Refactors:" >> CHANGELOG.md
git log $PREVIOUS_TAG..$CURRENT_TAG --grep='^refactor' --pretty=format:'* [`%h`](https://github.com/RyanYuuki/AnymeX/commit/%h): %s' >> CHANGELOG.md
echo "" >> CHANGELOG.md
# 🎨 Style Changes: (commits with 'style')
echo "## 🎨 Style Changes:" >> CHANGELOG.md
git log $PREVIOUS_TAG..$CURRENT_TAG --grep='^style' --pretty=format:'* [`%h`](https://github.com/RyanYuuki/AnymeX/commit/%h): %s' >> CHANGELOG.md
echo "" >> CHANGELOG.md
# 🚀 Performance Improvements: (commits with 'perf')
echo "## 🚀 Performance Improvements:" >> CHANGELOG.md
git log $PREVIOUS_TAG..$CURRENT_TAG --grep='^perf' --pretty=format:'* [`%h`](https://github.com/RyanYuuki/AnymeX/commit/%h): %s' >> CHANGELOG.md
echo "" >> CHANGELOG.md
# 🧹 Chores & Documentation: (commits with 'chore', 'docs')
echo "## 🧹 Chores & Documentation:" >> CHANGELOG.md
git log $PREVIOUS_TAG..$CURRENT_TAG --grep='^(chore|docs|build|ci)' --pretty=format:'* [`%h`](https://github.com/RyanYuuki/AnymeX/commit/%h): %s' >> CHANGELOG.md
# Output the generated changelog
cat CHANGELOG.md
- name: Commit and push changelog
run: |
git config --global user.name "GitHub Actions"
git config --global user.email "[email protected]"
git add CHANGELOG.md
git commit -m "Update changelog for version $CURRENT_TAG"
git push origin HEAD:main
- name: Update Release with Changelog
uses: ncipollo/release-action@v1
with:
bodyFile: "CHANGELOG.md"
token: ${{ secrets.GITHUB_TOKEN }}
allowUpdates: true
build-android:
runs-on: ubuntu-latest
needs: generate-changelog
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: "adopt"
java-version: "17"
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: "3.22.3"
- name: Get Dependencies
run: flutter pub get
- name: Build Android with Split ABI
run: flutter build apk --split-per-abi
- name: Rename APKs
run: |
mv build/app/outputs/flutter-apk/app-armeabi-v7a-release.apk build/app/outputs/flutter-apk/AnymeX-Android-armeabi-v7a.apk
mv build/app/outputs/flutter-apk/app-arm64-v8a-release.apk build/app/outputs/flutter-apk/AnymeX-Android-arm64.apk
mv build/app/outputs/flutter-apk/app-x86_64-release.apk build/app/outputs/flutter-apk/AnymeX-Android-x86_64.apk
- name: Build Universal APK
run: flutter build apk --release
- name: Rename Universal APK
run: mv build/app/outputs/flutter-apk/app-release.apk build/app/outputs/flutter-apk/AnymeX-Android-universal.apk
- name: Release Android APKs
uses: ncipollo/release-action@v1
with:
artifacts: "build/app/outputs/flutter-apk/AnymeX-Android-*.apk"
token: ${{ secrets.GITHUB_TOKEN }}
allowUpdates: true
tag: ${{ github.ref_name }}
build-ios:
runs-on: macos-latest
needs: generate-changelog
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: "3.22.3"
- name: Get Dependencies
run: flutter pub get
- name: Build iOS
run: |
flutter build ios --release --no-codesign
cd build/ios/iphoneos
mkdir -p Payload
cd Payload
ln -s ../Runner.app
cd ..
zip -r AnymeX-iOS-${{ github.ref_name }}.ipa Payload
mv AnymeX-iOS-${{ github.ref_name }}.ipa ../../../
- name: Release iOS IPA
uses: ncipollo/release-action@v1
with:
artifacts: "AnymeX-iOS-*.ipa"
token: ${{ secrets.GITHUB_TOKEN }}
allowUpdates: true
tag: ${{ github.ref_name }}
build-linux:
runs-on: ubuntu-latest
needs: generate-changelog
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get install -y ninja-build cmake g++ libgtk-3-dev libblkid-dev liblzma-dev pkg-config libmpv-dev libwebkit2gtk-4.1-dev
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: "3.22.3"
- name: Replace pubspec.yaml with Desktop Version
run: cp pubspec_desktop.yaml pubspec.yaml
- name: Get Dependencies
run: flutter pub get
- name: Replace video file extensions for desktops
run: |
mv lib/pages/Desktop/video_controls.darts lib/pages/Desktop/video_controls.dart
mv lib/pages/Desktop/watch_page.darts lib/pages/Desktop/watch_page.dart
- name: Build Linux
run: flutter build linux --release
- name: Zip Linux Artifacts
run: |
cd build/linux/x64/release/bundle
zip -r ../../../../../AnymeX-Linux.zip .
- name: Release Linux Build
uses: ncipollo/release-action@v1
with:
artifacts: "AnymeX-Linux.zip"
token: ${{ secrets.GITHUB_TOKEN }}
allowUpdates: true
tag: ${{ github.ref_name }}
build-windows:
runs-on: windows-latest
needs: generate-changelog
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: "3.22.3"
- name: Replace pubspec.yaml with Desktop Version
run: Copy-Item -Path pubspec_desktop.yaml -Destination pubspec.yaml -Force
- name: Replace video file extensions for desktops
run: |
mv lib/pages/Desktop/video_controls.darts lib/pages/Desktop/video_controls.dart
mv lib/pages/Desktop/watch_page.darts lib/pages/Desktop/watch_page.dart
- name: Get Dependencies
run: flutter pub get
- name: Build Windows
run: flutter build windows --release
- name: Create ZIP file for Windows Build
run: |
cd build/windows/x64/runner/Release
Compress-Archive -Path * -DestinationPath AnymeX-Windows.zip
- name: Setup Inno Setup
run: choco install innosetup -y
- name: Build Installer with Inno Setup
run: |
& "C:\Program Files (x86)\Inno Setup 6\ISCC.exe" inno.iss
- name: Release Windows Builds
uses: ncipollo/release-action@v1
with:
artifacts: "build/windows/x64/runner/Release/AnymeX-Windows.zip,output/AnymeX-Setup.exe"
token: ${{ secrets.GITHUB_TOKEN }}
allowUpdates: true
tag: ${{ github.ref_name }}
build-macos:
runs-on: macos-latest
needs: generate-changelog
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Setup Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: "3.22.3"
- name: Replace pubspec.yaml with Desktop Version
run: cp pubspec_macos.yaml pubspec.yaml
- name: Replace video file extensions for desktops
run: |
mv lib/pages/Desktop/video_controls.darts lib/pages/Desktop/video_controls.dart
mv lib/pages/Desktop/watch_page.darts lib/pages/Desktop/watch_page.dart
mv lib/auth/auth_provider_macos.dart lib/auth/auth_provider.dart
- name: Get Dependencies
run: flutter pub get
- name: Build macOS
run: flutter build macos --release
- name: Create DMG file for macOS Build
run: |
mkdir -p build/macos/Release
hdiutil create -volname "AnymeX" -srcfolder build/macos/Build/Products/Release/AnymeX.app -ov -format UDZO build/macos/Release/AnymeX.dmg
- name: Release macOS Builds
uses: ncipollo/release-action@v1
with:
artifacts: "build/macos/Release/AnymeX.dmg"
token: ${{ secrets.GITHUB_TOKEN }}
allowUpdates: true
tag: ${{ github.ref_name }}