Skip to content

Commit

Permalink
Merge pull request #49 from xfangfang/dev
Browse files Browse the repository at this point in the history
Dev update
  • Loading branch information
xfangfang authored Sep 10, 2021
2 parents ed69446 + 8e58b85 commit d9767f0
Show file tree
Hide file tree
Showing 27 changed files with 2,159 additions and 1,516 deletions.
23 changes: 13 additions & 10 deletions .github/workflows/build-macast.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
name: Build Macast

on:
push:
branches:
- linux_test
pull_request:
workflow_dispatch:
inputs:
Expand Down Expand Up @@ -33,7 +36,7 @@ jobs:
- name: Version
run: |
ls -R
export VERSION=`cat .version`
export VERSION=`cat macast/.version`
echo "VERSION=v$VERSION" >> $GITHUB_ENV
echo "DIST_DMG=Macast-MacOS-v${VERSION}.dmg" >> $GITHUB_ENV
echo "DIST_EXE=Macast-Windows-v${VERSION}.exe" >> $GITHUB_ENV
Expand Down Expand Up @@ -70,7 +73,7 @@ jobs:
id: compile
run: |
msgfmt -o i18n/zh_CN/LC_MESSAGES/macast.mo i18n/zh_CN/LC_MESSAGES/macast.po
export VERSION=`cat .version`
export VERSION=`cat macast/.version`
export DIST_AMD64_DEB=Macast-Linux-v${VERSION}-amd64.deb
export DIST_AMD64=Macast-Linux-v${VERSION}-amd64
echo "DIST_AMD64_DEB=${DIST_AMD64_DEB}" >> $GITHUB_ENV
Expand All @@ -80,10 +83,10 @@ jobs:
'pip install -r requirements/common.txt && \
pyinstaller --noconfirm -F -w \
--additional-hooks-dir=. \
--add-data=".version:." \
--add-data="macast/.version:." \
--add-data="macast/xml/*:macast/xml" \
--add-data="i18n/zh_CN/LC_MESSAGES/*.mo:i18n/zh_CN/LC_MESSAGES" \
--add-data="assets/*.png:assets" \
--add-data="macast/assets/*.png:assets" \
--exclude-module=tkinter \
--distpath="app" \
Macast.py'
Expand All @@ -97,7 +100,7 @@ jobs:
echo -e "Package: Macast\nVersion: ${VERSION}\nArchitecture: amd64\nMaintainer: xfangfang\nDescription: DLNA Media Renderer\nDepends: mpv" > dist/DEBIAN/control
echo -e "[Desktop Entry]\nName=Macast\nComment=DLNA Media Renderer\nExec=/usr/bin/macast\nIcon=/usr/share/icons/Macast.png\nTerminal=false\nType=Application\nCategories=Video" > dist/usr/share/applications/macast.desktop
cp app/Macast dist/usr/bin/macast
cp assets/icon.png dist/usr/share/icons/Macast.png
cp macast/assets/icon.png dist/usr/share/icons/Macast.png
dpkg -b dist $DIST_AMD64_DEB
echo "::set-output name=status::success"
Expand Down Expand Up @@ -142,13 +145,13 @@ jobs:
id: compile
run: |
./gettext/bin/msgfmt -o i18n/zh_CN/LC_MESSAGES/macast.mo i18n/zh_CN/LC_MESSAGES/macast.po
$VERSION=cat .version
$VERSION=cat macast/.version
echo "DIST_EXE=Macast-Windows-v${VERSION}.exe" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "DIST_EXE_DEBUG=Macast-Windows-v${VERSION}-debug.exe" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "VERSION=v${VERSION}" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
pyinstaller --noconfirm -F -w --additional-hooks-dir=. --add-data=".version;." --add-data="macast/xml/*;macast/xml" --add-data="i18n/zh_CN/LC_MESSAGES/*.mo;i18n/zh_CN/LC_MESSAGES" --add-data="assets/*;assets" --add-binary="bin/mpv.exe;bin" --icon=assets/icon.ico Macast.py
pyinstaller --noconfirm -F -w --additional-hooks-dir=. --add-data="macast/.version;." --add-data="macast/xml/*;macast/xml" --add-data="i18n/zh_CN/LC_MESSAGES/*.mo;i18n/zh_CN/LC_MESSAGES" --add-data="macast/assets/*;assets" --add-binary="bin/mpv.exe;bin" --icon=macast/assets/icon.ico Macast.py
cp dist/Macast.exe Macast-Windows-v${VERSION}.exe
pyinstaller --noconfirm -F --additional-hooks-dir=. --add-data=".version;." --add-data="macast/xml/*;macast/xml" --add-data="i18n/zh_CN/LC_MESSAGES/*.mo;i18n/zh_CN/LC_MESSAGES" --add-data="assets/*;assets" --add-binary="bin/mpv.exe;bin" --icon=assets/icon.ico Macast.py
pyinstaller --noconfirm -F --additional-hooks-dir=. --add-data="macast/.version;." --add-data="macast/xml/*;macast/xml" --add-data="i18n/zh_CN/LC_MESSAGES/*.mo;i18n/zh_CN/LC_MESSAGES" --add-data="macast/assets/*;assets" --add-binary="bin/mpv.exe;bin" --icon=macast/assets/icon.ico Macast.py
cp dist/Macast.exe Macast-Windows-v${VERSION}-debug.exe
echo "::set-output name=status::success"
Expand Down Expand Up @@ -183,9 +186,9 @@ jobs:
wget https://laboratory.stolendata.net/~djinn/mpv_osx/mpv-latest.tar.gz
mkdir -p bin && tar --strip-components 2 -C bin -xzvf mpv-latest.tar.gz mpv.app/Contents/MacOS
msgfmt -o i18n/zh_CN/LC_MESSAGES/macast.mo i18n/zh_CN/LC_MESSAGES/macast.po
python3 setup.py py2app
python3 setup_py2app.py py2app
cp -R bin dist/Macast.app/Contents/Resources/
export VERSION=`cat .version`
export VERSION=`cat macast/.version`
echo "DIST_DMG=Macast-MacOS-v${VERSION}.dmg" >> $GITHUB_ENV
echo "VERSION=v$VERSION" >> $GITHUB_ENV
create-dmg --window-pos 200 120 --window-size 800 400 --icon-size 100 --icon "Macast.app" 200 190 --hide-extension "Macast.app" --app-drop-link 600 185 --volname "Macast-v${VERSION} Installer" Macast-MacOS-v${VERSION}.dmg "dist/"
Expand Down
8 changes: 8 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
include *.md
recursive-include macast .version
recursive-include macast/xml *.xml
recursive-include macast/xml *.csv
recursive-include macast/scripts *.lua
recursive-include macast/assets *.png
recursive-include macast/assets *.icns
recursive-include macast/assets *.ico
Loading

0 comments on commit d9767f0

Please sign in to comment.