-
Notifications
You must be signed in to change notification settings - Fork 772
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
303 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
name: docker | ||
|
||
on: | ||
# Trigger this workflow when the "deploy" workflow has completed successfully | ||
# https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows#workflow_run | ||
workflow_run: | ||
workflows: | ||
- deploy | ||
branches: | ||
- master | ||
types: | ||
- completed | ||
|
||
jobs: | ||
|
||
# runs on x86-64 (xeon-d) host: matterhorn | ||
image_amd64: | ||
runs-on: [self-hosted, linux, X64] | ||
|
||
# docker images are only built and published (to DockerHub) when merging | ||
# to master (not a yet unmerged PR!) | ||
if: github.ref == 'refs/heads/master' | ||
|
||
env: | ||
AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }} | ||
AWS_S3_BUCKET_NAME: ${{ secrets.AWS_S3_BUCKET_NAME }} | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Set environment | ||
run: | | ||
echo AUTOBAHN_BUILD_DATE=`date -u +"%Y-%m-%d"` >> $GITHUB_ENV | ||
echo AUTOBAHN_BUILD_ID=$(date --utc +%Y%m%d)-$(git rev-parse --short ${GITHUB_SHA}) >> $GITHUB_ENV | ||
echo AUTOBAHN_VCS_REF=`git rev-parse --short ${GITHUB_SHA}` >> $GITHUB_ENV | ||
echo AUTOBAHN_VERSION=$(grep -E '^(__version__)' ./autobahn/_version.py | cut -d ' ' -f3 | sed -e 's|[u"'\'']||g') >> $GITHUB_ENV | ||
echo XBRNETWORK_EXE_FILENAME="xbrnetwork-linux-amd64-$(date --utc +%Y%m%d)-$(git rev-parse --short ${GITHUB_SHA})" >> $GITHUB_ENV | ||
- name: Print environment | ||
run: | | ||
echo "" | ||
echo "Build environment configured:" | ||
echo "" | ||
echo " AUTOBAHN_BUILD_DATE = ${AUTOBAHN_BUILD_DATE}" | ||
echo " AUTOBAHN_BUILD_ID = ${AUTOBAHN_BUILD_ID}" | ||
echo " AUTOBAHN_VCS_REF = ${AUTOBAHN_VCS_REF}" | ||
echo " AUTOBAHN_VERSION = ${AUTOBAHN_VERSION}" | ||
echo "" | ||
echo " XBRNETWORK_EXE_FILENAME = ${XBRNETWORK_EXE_FILENAME}" | ||
echo "" | ||
echo " AWS_DEFAULT_REGION = ${AWS_DEFAULT_REGION}" | ||
echo " AWS_S3_BUCKET_NAME = ${AWS_S3_BUCKET_NAME}" | ||
echo "" | ||
- name: Build & publish EXE | ||
run: | | ||
make build_exe | ||
make upload_exe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,3 +44,4 @@ coverage.xml | |
.coverage.* | ||
autobahn/xbr/contracts | ||
.wheels | ||
get-pip.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#!python | ||
|
||
import os | ||
|
||
if __name__ == '__main__': | ||
_EVAR = "AUTOBAHN_BUILD_ID" | ||
_SEARCH = "__build__ = u'00000'" | ||
_REPLACE = "__build__ = u'{}'" | ||
|
||
if _EVAR in os.environ: | ||
files = [] | ||
try: | ||
from autobahn import _version | ||
except ImportError: | ||
pass | ||
else: | ||
files.append(os.path.abspath(_version.__file__)) | ||
|
||
fn = 'autobahn/_version.py' | ||
if os.path.exists(fn): | ||
files.append(os.path.abspath(fn)) | ||
|
||
done = [] | ||
|
||
for fn in files: | ||
if fn in done: | ||
print('Skipping file "{}": already processed'.format(fn)) | ||
else: | ||
with open(fn) as f: | ||
contents = f.read() | ||
build_id_stmt = _REPLACE.format(os.environ[_EVAR]) | ||
if contents.find(_SEARCH): | ||
contents = contents.replace(_SEARCH, build_id_stmt) | ||
print(contents) | ||
with open(fn, 'w') as f: | ||
f.write(contents) | ||
f.flush() | ||
print('Ok: replaced placeholder build ID in file "{}" with "{}"'.format(fn, build_id_stmt)) | ||
done.append(fn) | ||
else: | ||
if contents.find(build_id_stmt): | ||
print('Skipping file "{}": build ID already correct') | ||
else: | ||
error_msg = 'Error: could not find search string "{}" to inject build ID in file "{}"'.format(_SEARCH, _version.__file__) | ||
raise Exception(error_msg) | ||
else: | ||
print('Skipping injection of build ID: AUTOBAHN_BUILD_ID not set') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
from PyInstaller.utils.hooks import collect_data_files | ||
|
||
datas = collect_data_files('autobahn') | ||
|
||
# Most of the following are found automatically by PyInstaller - but some are not! | ||
# To be on the safe side, we list _all_ modules here, which needs to be kept in | ||
# sync manually | ||
[ | ||
'autobahn', | ||
'autobahn.asyncio', | ||
'autobahn.asyncio.test', | ||
'autobahn.asyncio.xbr', | ||
'autobahn.nvx', | ||
'autobahn.nvx.test', | ||
'autobahn.rawsocket', | ||
'autobahn.rawsocket.test', | ||
'autobahn.test', | ||
'autobahn.twisted', | ||
'autobahn.twisted.test', | ||
'autobahn.twisted.testing', | ||
'autobahn.twisted.xbr', | ||
'autobahn.wamp', | ||
'autobahn.wamp.flatbuffers', | ||
'autobahn.wamp.gen', | ||
'autobahn.wamp.gen.schema', | ||
'autobahn.wamp.gen.wamp', | ||
'autobahn.wamp.gen.wamp.proto', | ||
'autobahn.wamp.test', | ||
'autobahn.websocket', | ||
'autobahn.websocket.test', | ||
'autobahn.xbr', | ||
'autobahn.xbr.templates', | ||
'autobahn.xbr.test' | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# https://github.com/pyinstaller/pyinstaller/issues/3390 | ||
|
||
import sys | ||
|
||
# this creates module: sys.modules['twisted.internet.reactor'] | ||
if sys.platform in ['win32']: | ||
from twisted.internet.iocpreactor import reactor as _iocpreactor | ||
_iocpreactor.install() | ||
else: | ||
from twisted.internet import default | ||
default.install() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
from pprint import pprint | ||
from PyInstaller.utils.hooks import collect_data_files | ||
|
||
datas = collect_data_files('xbr') | ||
|
||
pprint(datas) | ||
|
||
hiddenimports = [ | ||
'Crypto.Cipher', | ||
'Crypto.Signature', | ||
'Crypto.Hash', | ||
'Crypto.PublicKey', | ||
'Crypto.Protocol', | ||
'Crypto.IO', | ||
'Crypto.Random', | ||
'Crypto.Util', | ||
'Crypto.IO', | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# -*- mode: python ; coding: utf-8 -*- | ||
|
||
block_cipher = None | ||
|
||
|
||
a = Analysis(['../autobahn/xbr/_cli.py'], | ||
pathex=['/home/oberstet/scm/crossbario/autobahn-python/pyinstaller'], | ||
binaries=[], | ||
datas=[], | ||
hiddenimports=[], | ||
hookspath=['/home/oberstet/scm/crossbario/autobahn-python/pyinstaller'], | ||
runtime_hooks=[], | ||
excludes=[], | ||
win_no_prefer_redirects=False, | ||
win_private_assemblies=False, | ||
cipher=block_cipher, | ||
noarchive=False) | ||
pyz = PYZ(a.pure, a.zipped_data, | ||
cipher=block_cipher) | ||
exe = EXE(pyz, | ||
a.scripts, | ||
a.binaries, | ||
a.zipfiles, | ||
a.datas, | ||
[], | ||
name='xbrnetwork', | ||
debug=False, | ||
bootloader_ignore_signals=False, | ||
strip=False, | ||
upx=True, | ||
upx_exclude=[], | ||
runtime_tmpdir=None, | ||
console=True ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters