Skip to content

Commit

Permalink
Merge pull request #9215 from rtibbles/more_installers
Browse files Browse the repository at this point in the history
Add Debian and Windows installers to Github Action for PR Builds
  • Loading branch information
rtibbles committed Apr 6, 2022
2 parents e207ffb + cd9aef9 commit 6f7f0b8
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 15 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/build_whl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ jobs:
tar-file-name: ${{ steps.get-tar-filename.outputs.tar-file-name }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
lfs: true
- name: Install Ubuntu dependencies
run: |
sudo apt-get -y -qq update
Expand Down
39 changes: 26 additions & 13 deletions .github/workflows/pr_build_comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,23 +35,10 @@ jobs:
fs.writeFileSync(`${process.env.GITHUB_WORKSPACE}/pr_number.zip`, Buffer.from(download.data));
let text = `### [**Build Artifacts**](${context.payload.workflow_run.html_url})`
artifacts.sort((a, b) => {
if (a.name < b.name) {
return -1
}
if (b.name < a.name) {
return 1
}
return 0
})
const checkSuiteNumber = context.payload.workflow_run.check_suite_id
const repoHtmlUrl = context.payload.repository.html_url
const artifactsToDisplay = artifacts.filter((artifact) => {
return !artifact.expired && artifact.name != "pr_number"
})
const file_manifest = {
"deb": "Debian Package",
"dmg": "Mac Installer (DMG)",
Expand All @@ -62,6 +49,32 @@ jobs:
"zip": "Raspberry Pi Image",
}
const artifactsToDisplay = artifacts.filter((artifact) => {
return !artifact.expired && file_manifest[artifact.name.split('.').pop()]
})
const file_order = [
"whl",
"pex",
"exe",
"deb",
"dmg",
"zip",
"gz",
]
artifactsToDisplay.sort((a, b) => {
const a_order = file_order.findIndex(a.name.split('.').pop()) || 100
const b_order = file_order.findIndex(b.name.split('.').pop()) || 100
if (a_order < b_order) {
return -1
}
if (b_order < a_order) {
return 1
}
return 0
})
if (artifactsToDisplay.length) {
text += '\n| Asset type | Download link |\n|-|-|'
}
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/pr_build_kolibri.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,17 @@ jobs:
with:
whl-file-name: ${{ needs.whl.outputs.whl-file-name }}
ref: main
deb:
name: Build DEB file
needs: whl
uses: learningequality/kolibri-installer-debian/.github/workflows/build_deb.yml@master
with:
tar-file-name: ${{ needs.whl.outputs.tar-file-name }}
ref: master
exe:
name: Build EXE file
needs: whl
uses: learningequality/kolibri-installer-windows/.github/workflows/build_exe.yml@develop
with:
whl-file-name: ${{ needs.whl.outputs.whl-file-name }}
ref: develop
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,11 @@ dist: setrequirements writeversion staticdeps staticdeps-cext buildconfig i18n-e
python setup.py bdist_wheel
ls -l dist

pex: writeversion
ls dist/*.whl | while read whlfile; do pex $$whlfile --disable-cache -o dist/kolibri-`cat kolibri/VERSION | sed 's/+/_/g'`.pex -m kolibri --python-shebang=/usr/bin/python; done
read-whl-file-version:
python ./build_tools/read_whl_version.py ${whlfile} > kolibri/VERSION

pex:
ls dist/*.whl | while read whlfile; do $(MAKE) read-whl-file-version whlfile=$$whlfile; pex $$whlfile --disable-cache -o dist/kolibri-`cat kolibri/VERSION | sed 's/+/_/g'`.pex -m kolibri --python-shebang=/usr/bin/python; done

i18n-extract-backend:
cd kolibri && python -m kolibri manage makemessages -- -l en --ignore 'node_modules/*' --ignore 'kolibri/dist/*'
Expand Down
14 changes: 14 additions & 0 deletions build_tools/read_whl_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import sys

from pkginfo import Wheel


if __name__ == "__main__":
if len(sys.argv) != 2:
print("Usage: read_whl_version.py <whl_file>")
sys.exit(1)

whl_file = sys.argv[1]
whl = Wheel(whl_file)
print(whl.version)
sys.exit(0)
1 change: 1 addition & 0 deletions requirements/build.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ pex<1.6
setuptools>=20.3,<41,!=34.*,!=35.* # https://github.com/pantsbuild/pex/blob/master/pex/version.py#L6 # pyup: ignore
beautifulsoup4==4.8.2
requests==2.21.0
pkginfo==1.8.2

0 comments on commit 6f7f0b8

Please sign in to comment.