Skip to content

Commit

Permalink
action: linux
Browse files Browse the repository at this point in the history
  • Loading branch information
Paolo-Beci committed Apr 29, 2024
1 parent 3701049 commit ff37619
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 6 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/build-linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Build Workflow Windows

on:
push:
branches: master

jobs:
build-windows:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Install Python
uses: actions/setup-python@v1
with:
python-version: '3.12'
architecture: 'x64'
- name: Install requirements
run: |
pip install -r requirements.txt
- name: Run PyInstaller
run: |
pyinstaller --name SerialToUdpTranslatorV1.0 main.py --onefile --windowed
- uses: actions/upload-artifact@v2
with:
name: SerialToUdpTranslator
path: dist/SerialToUdpTranslatorV1.0.elf

- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.event.head_commit.message }}
release_name: ${{ github.event.head_commit.message }}
body: |
Release v1.0.0
draft: false
prerelease: false
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{steps.create_release.outputs.upload_url}}
asset_path: dist/SerialToUdpTranslatorV1.0.elf
asset_name: SerialToUdpTranslatorV1.0-Linux-x64.elf
asset_content_type: application/zip
8 changes: 2 additions & 6 deletions .github/workflows/build-win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,14 @@ jobs:
name: SerialToUdpTranslator
path: dist/SerialToUdpTranslatorV1.0.exe

- name: Generate Random String
id: random_string
run: echo "::set-output name=random_string::$(cat /dev/urandom | LC_CTYPE=C tr -dc 'a-zA-Z0-9' | fold -w 4 | head -n 1)"

- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.event.head_commit.message }}-${{ steps.random_string.outputs.random_string }}
release_name: ${{ github.event.head_commit.message }}-${{ steps.random_string.outputs.random_string }}
tag_name: ${{ github.event.head_commit.message }}
release_name: ${{ github.event.head_commit.message }}
body: |
Release v1.0.0
draft: false
Expand Down

0 comments on commit ff37619

Please sign in to comment.