Skip to content
Merged
61 changes: 58 additions & 3 deletions .github/workflows/build-and-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ on:
push:
branches:
- main
- PILOT-2936

jobs:
extract-branch-name:
Expand All @@ -21,10 +22,13 @@ jobs:
id: extract_branch
shell: bash
run: echo "branch=${GITHUB_REF#refs/heads/}" >> $GITHUB_OUTPUT
push-binary:

push-binary-linux:
needs: [ extract-branch-name ]
if: ${{ needs.extract-branch-name.outputs.branch == 'main' || needs.extract-branch-name.outputs.branch == 'develop' }}
if: ${{ needs.extract-branch-name.outputs.branch == 'main' || needs.extract-branch-name.outputs.branch == 'develop'}}
runs-on: ubuntu-20.04
outputs:
upload_url: ${{steps.create_release.outputs.upload_url}}
steps:
- name: Checkout repository
uses: actions/checkout@v3
Expand Down Expand Up @@ -84,5 +88,56 @@ jobs:
with:
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
asset_path: ./app/bundled_app/linux/${{ github.sha }}
asset_name: pilotcli
asset_name: pilotcli_linux
asset_content_type: application/octet-stream

push-binary-macos:
needs: [ push-binary-linux ]
if: ${{ needs.extract-branch-name.outputs.branch == 'main' || needs.extract-branch-name.outputs.branch == 'develop'}}
runs-on: macos-12

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this x86 or arm64?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
ref: ${{ needs.extract-branch-name.outputs.branch }}

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

- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: 1.3.2
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true

- name: Set up cache
id: cached-poetry-dependencies
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ hashFiles('**/poetry.lock') }}

- name: Ensure cache is healthy
if: steps.cached-poetry-dependencies.outputs.cache-hit == 'true'
run: timeout 10s poetry run pip --version || rm -rf .venv

- name: Install dependencies
run: poetry install --no-interaction --no-root

- name: Build binary
run: poetry run pyinstaller -F --distpath ./app/bundled_app/macos --specpath ./app/build/macos --workpath ./app/build/macos --paths=./.venv/lib/python3.9/site-packages ./app/pilotcli.py -n ${{ github.sha }}

- name: Upload Release Binary
id: upload-release-binary
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.push-binary-linux.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
asset_path: ./app/bundled_app/macos/${{ github.sha }}
asset_name: pilotcli_macos
asset_content_type: application/octet-stream
2 changes: 1 addition & 1 deletion app/resources/custom_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
class HelpPage:
page = {
'update': {
'version': '2.4.0',
'version': '2.4.3',
'1': 'The logic of normal upload and resumble are splited. '
'add new command for resumable upload as `pilotcli file resume -r manifest.json`',
'2': 'The manifest file will be output for both file/folder upload',
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "app"
version = "2.4.1"
version = "2.4.3"
description = "This service is designed to support pilot platform"
authors = ["Indoc Research"]

Expand Down