From ff37619bacc958cf88effc18579ec65e516872e8 Mon Sep 17 00:00:00 2001 From: Paolo Date: Mon, 29 Apr 2024 23:22:21 +0200 Subject: [PATCH] action: linux --- .github/workflows/build-linux.yml | 50 +++++++++++++++++++++++++++++++ .github/workflows/build-win.yml | 8 ++--- 2 files changed, 52 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/build-linux.yml diff --git a/.github/workflows/build-linux.yml b/.github/workflows/build-linux.yml new file mode 100644 index 0000000..34551c0 --- /dev/null +++ b/.github/workflows/build-linux.yml @@ -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 \ No newline at end of file diff --git a/.github/workflows/build-win.yml b/.github/workflows/build-win.yml index 3c9fa47..72f599d 100644 --- a/.github/workflows/build-win.yml +++ b/.github/workflows/build-win.yml @@ -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