Pyinstaller #20
Workflow file for this run
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
name: Publish Release | |
on: | |
workflow_dispatch: | |
inputs: | |
push: | |
description: Push to github releases? | |
required: false | |
default: false | |
type: boolean | |
workflow_call: | |
inputs: | |
push: | |
description: Push the image to the registry | |
required: false | |
default: true | |
type: boolean | |
jobs: | |
installer: | |
name: Pyinstaller | |
runs-on: ${{ matrix.os }}-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
os: | |
- windows | |
- ubuntu | |
- macos | |
steps: | |
- name: Get Tag Name | |
id: set_tag | |
shell: bash | |
env: | |
OS: ${{ matrix.os }} | |
run: | | |
GIT_TAG=${GITHUB_REF#refs/*/} | |
NAME="duploctl-${GIT_TAG}-${OS}" | |
echo "GIT_TAG=${GIT_TAG}" >> $GITHUB_OUTPUT | |
echo "NAME=${NAME}" >> $GITHUB_OUTPUT | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.12" | |
cache: pip | |
- name: Install Dependencies | |
run: pip install .[build] | |
- name: Pyinstaller | |
id: installer | |
run: pyinstaller cli.spec | |
- name: View Files | |
run: ls dist/cli | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ steps.set_tag.outputs.NAME }} | |
path: dist/cli/duploctl* | |
releaser: | |
name: Release | |
runs-on: ubuntu-latest | |
needs: installer | |
outputs: | |
name: ${{ steps.set_tag.outputs.NAME }} | |
steps: | |
- name: Dist Dir | |
id: dist_dir | |
run: mkdir -p dist artifacts | |
- name: Get Tag Name | |
id: set_tag | |
run: | | |
GIT_TAG=${GITHUB_REF#refs/*/} | |
NAME="duploctl-${GIT_TAG}" | |
echo "GIT_TAG=${GIT_TAG}" >> $GITHUB_OUTPUT | |
echo "NAME=${NAME}" >> $GITHUB_OUTPUT | |
- name: Download Artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
pattern: ${{ steps.set_tag.outputs.NAME }}-* | |
path: artifacts | |
merge-multiple: false | |
- name: Show Dist | |
shell: bash | |
run: | | |
for d in artifacts/*; do | |
name=$(basename $d) | |
file="$(find "$d" -type f -name "duploctl*")" | |
if [[ $file == *.exe ]]; then | |
name="${name}.exe" | |
fi | |
dest="dist/${name}" | |
echo "Copying $file to $dest" | |
done | |
ls dist | |
- name: Create Release | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
files: | | |
dist/* | |
body: | | |
duploctl ${{ steps.set_tag.outputs.GIT_TAG }} is out!. | |
prerelease: true |