Skip to content

Support macos

Support macos #120

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:
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Pages
uses: actions/setup-node@v3
with:
node-version: 20
- name: Setup MSBuild
uses: microsoft/setup-msbuild@v1
- name: Setup JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
cache: gradle
- name: Setup Flutter
uses: subosito/flutter-action@v2
- 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
echo '<html><head><script>if(!localStorage.getItem("musiche-proxy-address"))localStorage.setItem("musiche-proxy-address","https://music.picapico.top/proxy");localStorage.setItem("musiche-router-prefix","musiche");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 ..\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 ..
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
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
# Upload entire repository
path: 'web/dist'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
- name: Release
uses: softprops/action-gh-release@v1
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