Build Linux binary #167
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 workflow will build a PyOxidizer binary for linux when a tag is pushed | |
name: Build Linux binary | |
env: | |
PYAPP_DOWNLOAD: https://github.com/ofek/pyapp/releases/latest/download/source.tar.gz -Lo pyapp-source.tar.gz | |
on: | |
workflow_dispatch: {} | |
workflow_call: | |
push: | |
tags: | |
- '*' | |
release: | |
types: [published] | |
jobs: | |
build: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.9' | |
- name: Determine version | |
run: cat pyproject.toml | grep version -m 1 | awk '{ print "PYAPP_PROJECT_VERSION="substr($3, 2, length($3) -2)}' >> $GITHUB_ENV | |
- name: Setup PyOxidizer and build | |
working-directory: client/ | |
env: | |
PYAPP_PROJECT_NAME: gefyra | |
PYAPP_EXEC_SPEC: gefyra.cli.main:main | |
PYAPP_PIP_EXTRA_ARGS: click alive-progress tabulate cli-tracker | |
PYAPP_DISTRIBUTION_EMBED: 1 | |
PYAPP_SKIP_INSTALL: 1 | |
run: | | |
curl ${PYAPP_DOWNLOAD} | |
tar -xzf pyapp-source.tar.gz | |
mv pyapp-v* pyapp-latest | |
cd pyapp-latest | |
cargo build --release | |
cp `find build/ -name "gefyra"` ../gefyra | |
mv target/release/pyapp ../gefyra && chmod +x ../gefyra | |
cp README.md ../README.md | |
- name: Upload Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: gefyra-${{ env.PYAPP_PROJECT_VERSION }}-linux-amd64 | |
path: | | |
gefyra | |
LICENSE | |
README.md | |
retention-days: 5 | |
- name: Create release zip | |
if: ${{ github.event.release && github.event.action == 'published' }} | |
run: zip gefyra-${{ env.APP_VERSION }}-linux-amd64.zip "gefyra" "LICENSE" "README.md" | |
- name: Attach files to release | |
uses: softprops/action-gh-release@v2 | |
if: ${{ github.event.release && github.event.action == 'published' }} | |
with: | |
files: gefyra-${{ env.APP_VERSION }}-linux-amd64.zip |