This commit is contained in:
Christian Zangl 2024-01-13 18:38:24 +01:00
parent 57e3a81419
commit 04803c6714
No known key found for this signature in database
GPG Key ID: 6D468AC36E2A4B3D
2 changed files with 47 additions and 14 deletions

View File

@ -1,4 +1,5 @@
name: pyinstaller
name: build
on: [push] on: [push]
@ -15,6 +16,7 @@ jobs:
- uses: actions/setup-python@v5 - uses: actions/setup-python@v5
with: with:
python-version: '3.12' python-version: '3.12'
- name: prep - name: prep
shell: bash shell: bash
run: | run: |
@ -22,6 +24,7 @@ jobs:
python -m pip install pipenv pyinstaller==6.3.0 python -m pip install pipenv pyinstaller==6.3.0
pipenv install pipenv install
rm -rf build dist rm -rf build dist
- name: build - name: build
shell: bash shell: bash
run: | run: |
@ -32,28 +35,58 @@ jobs:
pipenv run pyinstaller run.py --hidden-import chkbit --hidden-import chkbit_cli --onefile --name chkbit --console --paths $SITEPKG pipenv run pyinstaller run.py --hidden-import chkbit --hidden-import chkbit_cli --onefile --name chkbit --console --paths $SITEPKG
cat build/chkbit/warn-chkbit.txt cat build/chkbit/warn-chkbit.txt
cd dist; ls -l cd dist; ls -l
if [ "$RUNNER_OS" == "Windows" ]; then if [ "$RUNNER_OS" == "Linux" ]; then
7z a -tzip chkbit.zip chkbit.exe tar -czf chkbit-linux_amd64.tar.gz chkbit
elif [ "$RUNNER_OS" == "macOS" ]; then
tar -czf chkbit-macos_amd64.tar.gz chkbit
elif [ "$RUNNER_OS" == "Windows" ]; then
7z a -tzip chkbit-windows_amd64.zip chkbit.exe
else else
tar -czf chkbit.tar.gz chkbit echo 'unknown runner'
exit 1
fi fi
- name: artifact - name: artifact
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v4
if: runner.os == 'Linux' if: runner.os == 'Linux'
with: with:
name: chkbit-linux_amd64.tar.gz name: binary-${{ matrix.os }}
path: dist/chkbit.tar.gz path: dist/chkbit*.tar.gz
- name: artifact - name: artifact
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v4
if: runner.os == 'macOS' if: runner.os == 'macOS'
with: with:
name: chkbit-macos_amd64.tar.gz name: binary-${{ matrix.os }}
path: dist/chkbit.tar.gz path: dist/chkbit*.tar.gz
- name: artifact - name: artifact
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v4
if: runner.os == 'Windows' if: runner.os == 'Windows'
with: with:
name: chkbit-windows_amd64.zip name: binary-${{ matrix.os }}
path: dist/chkbit.zip path: dist/chkbit*.zip
publish:
runs-on: ubuntu-latest
needs: build
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
steps:
- name: get-artifacts
uses: actions/download-artifact@v4
with:
path: dist
merge-multiple: true
- name: list
shell: bash
run: |
find
ls -l dist
- name: publish-release
uses: softprops/action-gh-release@v1
with:
draft: true
files: dist/*

View File

@ -1,5 +1,5 @@
name: Lint name: lint
on: [push, pull_request] on: [push, pull_request]