diff --git a/.github/workflows/build-and-publish.yml b/.github/workflows/build-and-publish.yml index 7af02d06..f3afece7 100644 --- a/.github/workflows/build-and-publish.yml +++ b/.github/workflows/build-and-publish.yml @@ -10,6 +10,7 @@ on: push: branches: - main + - PILOT-2936 jobs: extract-branch-name: @@ -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 @@ -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 + 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 diff --git a/app/resources/custom_help.py b/app/resources/custom_help.py index 80cd4c4f..3dd4ec59 100644 --- a/app/resources/custom_help.py +++ b/app/resources/custom_help.py @@ -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', diff --git a/pyproject.toml b/pyproject.toml index da1a2b85..9dd01c78 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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"]