Skip to content

Commit

Permalink
package standalone cli executable
Browse files Browse the repository at this point in the history
  • Loading branch information
rjra2611 committed Jan 17, 2023
1 parent 6800c89 commit d38f946
Showing 1 changed file with 63 additions and 1 deletion.
64 changes: 63 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.8
python-version: '3.8'

- name: Install packaging dependencies
run: pip install wheel
Expand All @@ -57,3 +57,65 @@ jobs:
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}

portable:
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ubuntu-22.04, macos-12, windows-latest]
python-version: ["3.10"]

# on a new tag (release), after 'test' and 'release' have ended we will run this
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
needs: [test, release]

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: Wait for pip release, sleep in seconds
run: sleep 900
shell: bash

- name: Setup Portable
run: pip install pyinstaller lean==${GITHUB_REF##*/}
shell: bash

- name: Create Portable
run: |
mkdir portable
cd portable
pyinstaller ../scripts/main.spec
shell: bash

- name: Zip package
if: matrix.os == 'windows-latest'
run: 7z a -tzip portable/dist/lean.${GITHUB_REF##*/}.${{ matrix.os }}.zip portable/dist/lean
shell: bash

- name: Zip package
if: matrix.os == 'macos-12' || matrix.os == 'ubuntu-22.04'
run: zip -r portable/dist/lean.${GITHUB_REF##*/}.${{ matrix.os }}.zip portable/dist/lean

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_KEY }}
aws-secret-access-key: ${{ secrets.AWS_SECRET }}
aws-region: us-west-1

- name: Publish To S3
run:
aws s3 cp portable/dist/lean.${GITHUB_REF##*/}.${{ matrix.os }}.zip s3://${{ secrets.AWS_BUCKET }}/${{ matrix.os }}/ --content-type "application/zip"
shell: bash

- name: Cleanup
run: |
rm -rf portable
shell: bash

0 comments on commit d38f946

Please sign in to comment.