Skip to content

Commit 931012f

Browse files
committed
Additional changes for binary building
1 parent 9d0ea89 commit 931012f

File tree

4 files changed

+32
-10
lines changed

4 files changed

+32
-10
lines changed

.github/workflows/pyinstaller.yml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ name: Build binary
22

33
on:
44
workflow_dispatch:
5+
push:
6+
tags:
7+
- '*'
58

69
jobs:
710
deploy:
@@ -20,21 +23,32 @@ jobs:
2023
python-version: '3.x'
2124

2225
- name: Install dependencies
26+
shell: bash
2327
run: |
2428
python -m pip install --upgrade pip
2529
pip install -r requirements/requirements.txt
2630
pip install -r requirements/requirements_dev.txt
2731
pip install pyinstaller
2832
2933
- name: Build binary
34+
shell: bash
3035
run: |
3136
invoke build-binary
3237
3338
- name: Test the binary
34-
run:
39+
shell: bash
40+
run: |
3541
invoke test-binary
3642
3743
- name: Prepare binary for upload
38-
run:
44+
shell: bash
45+
run: |
3946
invoke prepare-binary
47+
48+
- name: Upload release binaries
49+
uses: alexellis/[email protected]
50+
env:
51+
GITHUB_TOKEN: ${{ github.token }}
52+
with:
53+
asset_paths: '["./dist/*"]'
4054

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
0.11.1 (2021-02-13)
2+
-------------------
3+
4+
* Release for testing publishing of self-contained binaries built via pyinstaller
5+
16
0.11.0 (2021-01-18)
27
-------------------
38

aws_gate/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__version__ = "0.11.0"
1+
__version__ = "0.11.1"
22
__description__ = "aws-gate - AWS SSM Session Manager client CLI"
33
__author__ = "Adam Stevko"
44
__author_email__ = "[email protected]"

tasks.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,20 @@ def build_binary(ctx):
1212

1313
@task
1414
def test_binary(ctx):
15-
ctx.run("./dist/aws-gate --version")
16-
ctx.run("./dist/aws-gate --help")
15+
ctx.run(f"{os.path.join('dist', 'aws-gate')} --version")
16+
ctx.run(f"{os.path.join('dist', 'aws-gate')} --help")
1717

1818

1919
@task
2020
def prepare_binary(ctx): # pylint: disable=unused-argument
21-
binary_name = "aws-gate"
22-
binary_path = f"./dist/{binary_name}"
23-
platform_suffix = f"{platform.system()}_{platform.machine()}"
24-
platform_binary_name = f"{binary_name}-{platform_suffix}"
25-
platform_binary_path = f"{binary_path}-{platform_suffix}"
21+
if platform.system() == "Windows":
22+
binary_name = "aws-gate.exe"
23+
else:
24+
binary_name = "aws-gate"
25+
binary_path = f"{os.path.join('dist', binary_name)}"
26+
platform_suffix = f"{platform.system()}_{platform.machine().lower()}"
27+
platform_binary_name = f"{binary_name}_{platform_suffix}"
28+
platform_binary_path = f"{binary_path}_{platform_suffix}"
2629

2730
os.rename(binary_path, platform_binary_path)
2831

0 commit comments

Comments
 (0)