Skip to content

Fix LocalCache

Fix LocalCache #148

Workflow file for this run

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 ..\proxy-windows
echo "<Weavers><Costura/></Weavers>" > FodyWeavers.xml
msbuild ProxyServer.sln -t:"Restore;Build" /p:Configuration=Release /p:Platform="Any CPU"
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 proxy-windows\bin\Release\net472\ProxyServer.exe web\dist\ProxyServer.exe -ErrorAction SilentlyContinue
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
web\dist\ProxyServer.exe