-
Notifications
You must be signed in to change notification settings - Fork 5
141 lines (126 loc) · 4.78 KB
/
web.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
name: Deploy static content to Pages
on:
push:
branches: ['master']
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: 'pages'
cancel-in-progress: false
jobs:
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@v4
- name: Setup Pages
uses: actions/setup-node@v4
with:
node-version: 20
- name: Setup MSBuild
uses: microsoft/setup-msbuild@v2
- name: Setup JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: gradle
- 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
node web\scripts\version.js
Remove-Item windows\logo.ico -Force -ErrorAction SilentlyContinue
Remove-Item web\public\logo.png -Force -ErrorAction SilentlyContinue
Remove-Item web\public\logo-circle.png -Force -ErrorAction SilentlyContinue
Remove-Item mobile\assets -Force -Recurse -ErrorAction SilentlyContinue
copy resources\logo.ico windows\logo.ico
copy resources\logo.png web\public\logo.png
copy resources\logo-circle.png web\public\logo-circle.png
cd web
yarn
yarn build:zip
cd ..\windows
echo "<Weavers><Costura/></Weavers>" > FodyWeavers.xml
mv ..\web\web.zip Resources\web.zip
msbuild Musiche.sln -t:"Restore;Build" /p:Configuration=Release /p:Platform="Any CPU"
msbuild Musiche.sln -t:"Restore;Build;Publish" /p:Configuration=Release /p:Platform="Any CPU" /p:PublishProfile="Properties\PublishProfiles\net6.0.pubxml" /p:TargetFramework=net6.0-windows
cd ..\mobile
Copy-Item ..\web\dist assets -Force -Recurse
flutter build apk --release
cd ..\web
Remove-Item dist -Force -Recurse -ErrorAction SilentlyContinue
yarn build:musiche
echo '<html><head><script>if(!localStorage.getItem("musiche-proxy-address"))localStorage.setItem("musiche-proxy-address","https://music.picapico.top/proxy");let pathname=location.pathname.substring(9);let redirect=pathname?`${(location.search?"&":"?")}redirect=${pathname}`:"";location.href="/musiche"+location.search+redirect;</script></head></html>' > dist\404.html
cd ..
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@v3
with:
# Upload entire repository
path: 'web/dist'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
- name: Release
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