Build-Release #17
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: Build-Release-Linux | |
on: | |
push: | |
tags: | |
- "*" | |
jobs: | |
build-docker: | |
runs-on: ubuntu-latest | |
needs: | |
- build-linux-amd64 | |
steps: | |
- name: Docker login | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_PASSWORD }} | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Build the Docker image | |
run: docker build -f Dockerfile.build -t ${{ secrets.DOCKERHUB_USERNAME }}/fishbot_tool:${{ env.REF_NAME }} . | |
- name: Docker image push | |
run: docker push ${{ secrets.DOCKERHUB_USERNAME }}/fishbot_tool:${{ env.REF_NAME }} | |
build-linux-amd64: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: install dependencies | |
run: sudo apt update && sudo apt install libqt6* libxcb-cursor-dev -y | |
- name: Set up Python 3.10.10 | |
uses: actions/setup-python@master | |
with: | |
python-version: 3.10.10 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install pyinstaller | |
pip install pyserial requests PyQt6 | |
- name: Build with PyInstaller | |
run: pyinstaller release_linux.spec | |
- name: Generate file list for bin directory | |
id: file_list | |
run: | | |
file_list=$(ls -1 dist/*) # Only list .bin files in the bin directory | |
echo "FILES=$file_list" >> $GITHUB_ENV | |
echo "REF_NAME=$GITHUB_REF_NAME" >> $GITHUB_ENV | |
- name: Create Release and Upload Release Asset | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
tag_name: ${{ github.ref }} | |
name: ${{ env.REF_NAME }} | |
body_path: release-notes.md | |
token: ${{ secrets.ACCESS_TOKEN }} | |
draft: false | |
prerelease: false | |
files: | | |
${{ env.FILES }} | |
fishbot_tool_cli.py |