Skip to content

Pyinstaller

Pyinstaller #32

Workflow file for this run

name: Pyinstaller
on:
workflow_dispatch:
inputs:
push:
description: Push the artifact to github.
required: false
default: true
type: boolean
tag:
description: The git tag to build on
required: false
type: string
workflow_call:
inputs:
push:
description: Push the artifact to github.
required: false
default: true
type: boolean
tag:
description: The git tag to build on
required: false
type: string
secrets:
GH_APP_KEY:
description: GitHub App private key
required: true
jobs:
installer:
name: Pyinstaller
runs-on: ${{ matrix.os.runs-on }}
strategy:
fail-fast: false
matrix:
os:
- name: windows
runs-on: windows-latest
multiarch: false
- name: linux
runs-on: ubuntu-latest
multiarch: true
- name: darwin
runs-on: macos-latest
multiarch: false
arch:
- amd64
steps:
- name: Get Tag Name
id: info
shell: bash
env:
OS: ${{ matrix.os.name }}
ARCH: ${{ matrix.arch }}
GIT_TAG: ${{ inputs.tag }}
run: |
if [ -z "${GIT_TAG}" ]; then
GIT_TAG=${GITHUB_REF#refs/*/}
fi
VERSION="${GIT_TAG#v*}"
NAME="duploctl-${VERSION}-${OS}"
echo "GIT_TAG=${GIT_TAG}" >> $GITHUB_OUTPUT
echo "NAME=${NAME}" >> $GITHUB_OUTPUT
- name: Setup
id: setup
uses: duplocloud/duploctl/.github/actions/setup@main
with:
ref: ${{ inputs.tag }}
app-id: ${{ vars.GH_APP_ID }}
private-key: ${{ secrets.GH_APP_KEY }}
install: ".[build]"
- name: Pyinstaller
id: installer
if: matrix.os.multiarch == false
run: pyinstaller scripts/installer.spec
# Use buildx to build the bin target which has the binary inside
# then output the binary to the dist folder
- name: Buildx MultiArch Installer
if: matrix.os.multiarch
id: installer-multiarch
uses: duplocloud/actions/build-image@main
with:
platforms: linux/amd64,linux/arm64
push: false
target: bin
cache-scope: installer
build-args: >
PY_VERSION=3.12
extra-args: --output=type=local,dest=./dist
- name: View Files
run: ls dist
- name: Single Artifact
uses: actions/upload-artifact@v4
if: matrix.os.multiarch == false && inputs.push
with:
name: ${{ steps.info.outputs.NAME }}-${{ matrix.arch }}
path: dist
- name: Amd Artifact
uses: actions/upload-artifact@v4
if: matrix.os.multiarch && inputs.push
with:
name: ${{ steps.info.outputs.NAME }}-amd64
path: dist/${{ matrix.os.name }}_amd64
- name: Arm Artifact
uses: actions/upload-artifact@v4
if: matrix.os.multiarch && inputs.push
with:
name: ${{ steps.info.outputs.NAME }}-arm64
path: dist/${{ matrix.os.name }}_arm64