Build-Release #30
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 | |
on: | |
push: | |
tags: | |
- "*" | |
jobs: | |
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 | |
python -m pip install --upgrade pip | |
pip install pyinstaller pyserial requests PyQt6 | |
- name: Build with PyInstaller | |
run: pyinstaller release_linux.spec | |
- name: Archive build artifacts | |
uses: actions/upload-artifact@v2 | |
with: | |
name: build-artifacts | |
path: dist | |
- name: Copy Bin For Docker | |
run: mkdir dist-for-docker && cp $(ls -1 dist/*) dist-for-docker/fishbot_tool_linux_amd64 | |
- name: Archive build artifacts docker | |
uses: actions/upload-artifact@v2 | |
with: | |
name: build-artifacts-for-docker | |
path: dist-for-docker | |
build-windows: | |
runs-on: windows-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install pyinstaller pyserial requests PyQt6 | |
- name: Build with PyInstaller | |
run: pyinstaller release_win.spec | |
- name: Archive build artifacts | |
uses: actions/upload-artifact@v2 | |
with: | |
name: build-artifacts | |
path: dist | |
build-cli-version: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Copy file to dist | |
run: mkdir dist && mv fishbot_tool_cli.py dist/ | |
- name: Archive build artifacts | |
uses: actions/upload-artifact@v2 | |
with: | |
name: build-artifacts | |
path: dist | |
build-release-docker: | |
runs-on: ubuntu-latest | |
needs: [build-linux-amd64] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Download built artifacts | |
uses: actions/download-artifact@v2 | |
with: | |
name: build-artifacts-for-docker | |
path: ./dist-for-docker | |
- name: Docker login | |
uses: docker/login-action@v1 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_PASSWORD }} | |
- name: Build the Docker image | |
run: docker build -f Dockerfile -t fishros2/fishbot_tool . | |
- name: Docker image push | |
run: docker push fishros2/fishbot_tool | |
release: | |
runs-on: ubuntu-22.04 | |
needs: [build-release-docker, build-windows, build-cli-version] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Download built artifacts | |
uses: actions/download-artifact@v2 | |
with: | |
name: build-artifacts | |
path: ./dist | |
- name: Update release notes | |
run: | | |
sed -i 's/DOCKER-TAG/latest/g' ./release-notes.md | |
- name: Create Release and Upload Release Asset | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
tag_name: ${{ env.REF_NAME }} | |
name: ${{ env.REF_NAME }} | |
body_path: release-notes.md | |
token: ${{ secrets.ACCESS_TOKEN }} | |
draft: false | |
prerelease: false | |
files: | | |
dist/* |