Skip to content

Commit b7575fe

Browse files
committed
this should bulid for linux, windows, and mac
1 parent faeb612 commit b7575fe

File tree

2 files changed

+93
-125
lines changed

2 files changed

+93
-125
lines changed

.github/workflows/build.yml

Lines changed: 88 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -9,94 +9,94 @@ on:
99

1010
jobs:
1111

12-
# linux:
13-
# runs-on: ubuntu-latest
14-
## container: debian:buster-slim
15-
#
16-
# steps:
17-
#
18-
# - uses: actions/checkout@v2
19-
#
20-
# - name: Execute script to build linux AppImage
21-
# run: "build/linux/buildAppImage.sh"
22-
# shell: bash
23-
#
24-
# - uses: actions/upload-artifact@v2
25-
# with:
26-
# name: helloWorld-linux-x86_64
27-
# path: dist/
28-
#
29-
# - name: Create dist tarball
30-
# run: 'tar -cjvf helloWorld-linux-x86_64.${{ github.run_id }}.tar.bz2 dist/*'
31-
# shell: bash
32-
#
33-
# - name: Create Release
34-
# id: create_release
35-
# uses: actions/create-release@v1
36-
# env:
37-
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
38-
# with:
39-
# tag_name: ${{ github.run_id }}_linux
40-
# release_name: 'Public Build Artifact: Linux ${{ github.run_id }}'
41-
# draft: false
42-
# prerelease: true
43-
#
44-
# - name: Upload Release Asset
45-
# id: upload-release-asset
46-
# uses: actions/upload-release-asset@v1
47-
# env:
48-
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
49-
# with:
50-
# upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
51-
# asset_path: helloWorld-linux-x86_64.${{ github.run_id }}.tar.bz2
52-
# asset_name: helloWorld-linux-x86_64.${{ github.run_id }}.tar.bz2
53-
# asset_content_type: application/x-bzip2
54-
#
55-
# windows:
56-
# runs-on: windows-latest
57-
#
58-
# steps:
59-
# - uses: actions/checkout@v2
60-
#
61-
# - name: Execute script to .exe in Windows
62-
# run: "build/windows/buildExe.ps1"
63-
# shell: powershell -Command "& '{0}'"
64-
#
65-
# - uses: actions/upload-artifact@v2
66-
# with:
67-
# name: Windows executable (x86_64)
68-
# path: dist/
69-
#
70-
# - uses: actions/upload-artifact@v2
71-
# with:
72-
# name: helloWorld-windows-x86_64
73-
# path: dist/
74-
#
75-
# - name: Create Release .zip
76-
# run: 'Compress-Archive -DestinationPath helloWorld-windows-x86_64.${{ github.run_id }}.zip -Path dist\*'
77-
# shell: powershell
78-
#
79-
# - name: Create Release
80-
# id: create_release
81-
# uses: actions/create-release@v1
82-
# env:
83-
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
84-
# with:
85-
# tag_name: ${{ github.run_id }}_windows
86-
# release_name: 'Public Build Artifact: Windows ${{ github.run_id }}'
87-
# draft: false
88-
# prerelease: true
89-
#
90-
# - name: Upload Release Asset
91-
# id: upload-release-asset
92-
# uses: actions/upload-release-asset@v1
93-
# env:
94-
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
95-
# with:
96-
# upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
97-
# asset_path: helloWorld-windows-x86_64.${{ github.run_id }}.zip
98-
# asset_name: helloWorld-windows-x86_64.${{ github.run_id }}.zip
99-
# asset_content_type: application/zip
12+
linux:
13+
runs-on: ubuntu-latest
14+
# container: debian:buster-slim
15+
16+
steps:
17+
18+
- uses: actions/checkout@v2
19+
20+
- name: Execute script to build linux AppImage
21+
run: "build/linux/buildAppImage.sh"
22+
shell: bash
23+
24+
- uses: actions/upload-artifact@v2
25+
with:
26+
name: helloWorld-linux-x86_64
27+
path: dist/
28+
29+
- name: Create dist tarball
30+
run: 'tar -cjvf helloWorld-linux-x86_64.${{ github.run_id }}.tar.bz2 dist/*'
31+
shell: bash
32+
33+
- name: Create Release
34+
id: create_release
35+
uses: actions/create-release@v1
36+
env:
37+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
38+
with:
39+
tag_name: ${{ github.run_id }}_linux
40+
release_name: 'Public Build Artifact: Linux ${{ github.run_id }}'
41+
draft: false
42+
prerelease: true
43+
44+
- name: Upload Release Asset
45+
id: upload-release-asset
46+
uses: actions/upload-release-asset@v1
47+
env:
48+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
49+
with:
50+
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
51+
asset_path: helloWorld-linux-x86_64.${{ github.run_id }}.tar.bz2
52+
asset_name: helloWorld-linux-x86_64.${{ github.run_id }}.tar.bz2
53+
asset_content_type: application/x-bzip2
54+
55+
windows:
56+
runs-on: windows-latest
57+
58+
steps:
59+
- uses: actions/checkout@v2
60+
61+
- name: Execute script to .exe in Windows
62+
run: "build/windows/buildExe.ps1"
63+
shell: powershell -Command "& '{0}'"
64+
65+
- uses: actions/upload-artifact@v2
66+
with:
67+
name: Windows executable (x86_64)
68+
path: dist/
69+
70+
- uses: actions/upload-artifact@v2
71+
with:
72+
name: helloWorld-windows-x86_64
73+
path: dist/
74+
75+
- name: Create Release .zip
76+
run: 'Compress-Archive -DestinationPath helloWorld-windows-x86_64.${{ github.run_id }}.zip -Path dist\*'
77+
shell: powershell
78+
79+
- name: Create Release
80+
id: create_release
81+
uses: actions/create-release@v1
82+
env:
83+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
84+
with:
85+
tag_name: ${{ github.run_id }}_windows
86+
release_name: 'Public Build Artifact: Windows ${{ github.run_id }}'
87+
draft: false
88+
prerelease: true
89+
90+
- name: Upload Release Asset
91+
id: upload-release-asset
92+
uses: actions/upload-release-asset@v1
93+
env:
94+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
95+
with:
96+
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
97+
asset_path: helloWorld-windows-x86_64.${{ github.run_id }}.zip
98+
asset_name: helloWorld-windows-x86_64.${{ github.run_id }}.zip
99+
asset_content_type: application/zip
100100

101101
mac:
102102
runs-on: macos-latest

build/mac/buildDmg.sh

Lines changed: 5 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ set -x
77
#
88
# * https://kivy.org/doc/stable/installation/installation-osx.html
99
# * https://kivy.org/doc/stable/guide/packaging-osx.html
10-
# * https://github.com/kivy/buildozer/issues/494#issuecomment-390262889
10+
# * https://blog.fossasia.org/deploying-a-kivy-application-with-pyinstaller-for-mac-osx-to-github/
1111
#
1212
# Authors: Michael Altfield <[email protected]>
1313
# Created: 2020-06-22
@@ -26,15 +26,11 @@ APP_NAME='helloWorld'
2626
PYTHON_VERSION="`${PYTHON_PATH} --version | cut -d' ' -f2`"
2727
PYTHON_EXEC_VERSION="`echo ${PYTHON_VERSION} | cut -d. -f1-2`"
2828

29-
# attempt to overwrite brew's /usr/local/bin/python3 with /usr/bin/python3
30-
#alias python3='${PYTHON_PATH}'
31-
3229
########
3330
# INFO #
3431
########
3532

3633
# print some info for debugging failed builds
37-
3834
uname -a
3935
sw_vers
4036
which python2
@@ -46,18 +42,6 @@ echo $PATH
4642
pwd
4743
ls -lah
4844

49-
echo "INFO: list of python* in /usr/bin/"
50-
ls -lah /usr/bin/python*
51-
find /usr/bin -type f -name python | xargs --version
52-
find /usr/bin -type f -name python3 | xargs --version
53-
md5 /usr/bin/python*
54-
55-
echo "INFO: list of python* in /usr/local/bin/"
56-
ls -lah /usr/local/bin/python*
57-
find /usr/local/bin -type f -name python | xargs --version
58-
find /usr/local/bin -type f -name python3 | xargs --version
59-
md5 /usr/local/bin/python*
60-
6145
###################
6246
# INSTALL DEPENDS #
6347
###################
@@ -68,7 +52,6 @@ brew update
6852

6953
# install os-level depends
7054
brew install wget python3
71-
#brew reinstall --build-bottle sdl2 sdl2_image sdl2_ttf sdl2_mixer
7255
brew reinstall sdl2 sdl2_image sdl2_ttf sdl2_mixer
7356

7457
# setup a virtualenv to isolate our app's python depends
@@ -83,14 +66,13 @@ ${PYTHON_PATH} -m pip install --upgrade --user Cython==0.29.10
8366
${PYTHON_PATH} -m pip install --upgrade --user -r requirements.txt
8467
${PYTHON_PATH} -m pip install --upgrade --user PyInstaller
8568

86-
#######################
87-
# PREPARE PYINSTALLER #
88-
#######################
69+
#####################
70+
# PYINSTALLER BUILD #
71+
#####################
8972

9073
mkdir pyinstaller
9174
pushd pyinstaller
9275

93-
# TODO: change this to cat
9476
${PYTHON_PATH} -m PyInstaller -y --clean --windowed --name ${APP_NAME} \
9577
--hidden-import 'pkg_resources.py2_warn' \
9678
--exclude-module _tkinter \
@@ -99,12 +81,6 @@ ${PYTHON_PATH} -m PyInstaller -y --clean --windowed --name ${APP_NAME} \
9981
--exclude-module twisted \
10082
../src/main.py
10183

102-
#########
103-
# BUILD #
104-
#########
105-
106-
#pyinstaller -y --clean --windowed ${APP_NAME}.spec
107-
10884
pushd dist
10985
hdiutil create ./${APP_NAME}.dmg -srcfolder ${APP_NAME}.app -ov
11086
popd
@@ -113,13 +89,6 @@ popd
11389
# PREPARE ARTIFACTS #
11490
#####################
11591

116-
# TODO: remove this after fixing .dmg generation
117-
# the dmg generation below fails on headless builds because you have to click
118-
# a button in a dialog granting finder some permissions from the apple script.
119-
# for now we include the .app
120-
mkdir -p ../dist
121-
cp -r "${APP_NAME}.app" ../dist/
122-
12392
# create the dist dir for our result to be uploaded as an artifact
12493
mkdir -p ../dist
12594
cp "dist/${APP_NAME}.dmg" ../dist/
@@ -135,9 +104,8 @@ python2 --version
135104
which python3
136105
python3 --version
137106
${PYTHON_PATH} --version
138-
pwd
139107
echo $PATH
140-
ls -lah /Users/runner/Library/Python/3.7/bin
108+
pwd
141109
ls -lah
142110
ls -lah dist
143111

0 commit comments

Comments
 (0)