Skip to content

Commit

Permalink
Support build macos,ios
Browse files Browse the repository at this point in the history
  • Loading branch information
HeHang0 committed Mar 24, 2024
1 parent 65506a7 commit 73d9995
Show file tree
Hide file tree
Showing 3 changed files with 95 additions and 11 deletions.
66 changes: 58 additions & 8 deletions .github/workflows/web.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,25 +14,66 @@ concurrency:
cancel-in-progress: false

jobs:
deploy:
build-on-macos:
runs-on: macos-14
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20

- name: Setup Flutter
uses: subosito/flutter-action@v2

- name: Build
run: |
sw_vers -productVersion
xcodebuild -version
node web/scripts/version.js
npm install -g appdmg
cd web
yarn
yarn build
cd ../mobile
flutter pub get
flutter build ios --release --no-codesign
flutter build macos --release
appdmg dmg.json musiche.dmg
mkdir Payload
mv build/ios/Release-iphoneos/*.app Payload/musiche.app
zip -r musiche.zip Payload
mv musiche.zip musiche.ipa
- name: Upload macOS package
uses: actions/upload-artifact@v4
with:
name: macos-package
path: |
mobile/musiche.dmg
mobile/musiche.ipa
build-on-windows:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: windows-latest
needs: build-on-macos
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Pages
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 20

- name: Setup MSBuild
uses: microsoft/setup-msbuild@v1
uses: microsoft/setup-msbuild@v2

- name: Setup JDK 17
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
Expand All @@ -41,6 +82,11 @@ jobs:
- name: Setup Flutter
uses: subosito/flutter-action@v2

- name: Download macOS package
uses: actions/download-artifact@v4
- name: Display structure of downloaded files
run: ls -R

- name: Build
run: |
powershell
Expand Down Expand Up @@ -68,21 +114,25 @@ jobs:
copy windows\bin\Release\net472\Musiche.exe web\dist\Musiche.exe -ErrorAction SilentlyContinue
copy windows\bin\Publish\net6.0-windows\Musiche.exe web\dist\Musiche.net6.exe -ErrorAction SilentlyContinue
copy mobile\build\app\outputs\flutter-apk\app-release.apk web\dist\Musiche.apk -ErrorAction SilentlyContinue
copy macos-package\musiche.dmg web\dist\Musiche.dmg -ErrorAction SilentlyContinue
copy macos-package\musiche.ipa web\dist\Musiche.ipa -ErrorAction SilentlyContinue
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
uses: actions/upload-pages-artifact@v3
with:
# Upload entire repository
path: 'web/dist'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
uses: actions/deploy-pages@v4

- name: Release
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
windows\Resources\web.zip
web\dist\Musiche.exe
web\dist\Musiche.net6.exe
web\dist\Musiche.apk
web\dist\Musiche.ipa
web\dist\Musiche.dmg
21 changes: 21 additions & 0 deletions mobile/dmg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"title": "音乐和",
"icon": "build/macos/Build/Products/Release/musiche.app/Contents/Resources/AppIcon.icns",
"background-color": "#b9e7e4",
"icon-size": 80,
"contents": [
{ "x": 340, "y": 120, "type": "link", "path": "/Applications" },
{
"x": 140,
"y": 120,
"type": "file",
"path": "build/macos/Build/Products/Release/musiche.app"
}
],
"window": {
"size": {
"width": 480,
"height": 300
}
}
}
19 changes: 16 additions & 3 deletions web/src/views/setting.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1015,6 +1015,20 @@ onUnmounted(unWatch);
</div>
<p>PC版(NET6)</p>
</a>
<a
class="music-setting-about-card"
href="https://hehang0.github.io/musiche/Musiche.dmg"
target="_blank">
<div
class="logo-app"
style="
--logo-app-color: var(--music-footer-background);
color: white;
">
<el-icon size="44"><AppleImage /></el-icon>
</div>
<p>MacOS版</p>
</a>
<a
class="music-setting-about-card"
href="https://hehang0.github.io/musiche/Musiche.apk"
Expand Down Expand Up @@ -1396,6 +1410,8 @@ onUnmounted(unWatch);
&-download {
display: flex;
margin-top: 30px;
gap: 20px;
flex-wrap: wrap;
}
&-update {
cursor: pointer;
Expand All @@ -1409,9 +1425,6 @@ onUnmounted(unWatch);
text-align: center;
cursor: pointer;
color: inherit; //-webkit-link;
& + & {
margin-left: 20px;
}
&:hover {
p {
text-decoration: underline;
Expand Down

0 comments on commit 73d9995

Please sign in to comment.