Skip to content

Commit

Permalink
fix exe build using recent actions (#51)
Browse files Browse the repository at this point in the history
* fix exe build using recent actions
  • Loading branch information
double16 authored May 21, 2024
1 parent 9c370f3 commit f77c3a8
Show file tree
Hide file tree
Showing 2 changed files with 111 additions and 90 deletions.
113 changes: 111 additions & 2 deletions .github/workflows/app.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: Build

on:
release:
types: [published]
push:
branches:
- 'main'
tags:
- "v*.*.*"
paths-ignore:
- '**.md'
- 'docs/**'
Expand Down Expand Up @@ -100,3 +100,112 @@ jobs:
tags: ${{ steps.meta.outputs.tags }}
annotations: ${{ steps.meta.outputs.annotations }}
labels: ${{ steps.meta.outputs.labels }}

build-exe:
name: Build packages
if: ${{ startsWith(github.ref, 'refs/heads/') || startsWith(github.ref, 'refs/tags/') }}
needs: [ test ]
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
TARGET: linux
CMD_BUILD: pyinstaller -p shadycompass --onefile --console --name shadycompass shadycompass.py
OUT_FILE_NAME: shadycompass
RELEASE_FILE_NAME: shadycompass_${{github.ref_name}}_linux_amd64
ASSET_MIME: application/octet-stream
- os: macos-latest
TARGET: macos
CMD_BUILD: pyinstaller -p shadycompass --onefile --console --name shadycompass shadycompass.py
OUT_FILE_NAME: shadycompass
RELEASE_FILE_NAME: shadycompass_${{github.ref_name}}_macos
ASSET_MIME: application/octet-stream
- os: windows-latest
TARGET: windows
CMD_BUILD: pyinstaller -p shadycompass --onefile --console --name shadycompass shadycompass.py
OUT_FILE_NAME: shadycompass.exe
RELEASE_FILE_NAME: shadycompass_${{github.ref_name}}.exe
ASSET_MIME: application/vnd.microsoft.portable-executable
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: 3.12
cache: 'pip'
- name: Install dependencies
run: |
pip install -r requirements.txt
pip install pyinstaller
- name: Build with pyinstaller for ${{matrix.TARGET}}
run: |
${{matrix.CMD_BUILD}}
mv ./dist/${{ matrix.OUT_FILE_NAME }} ./dist/${{ matrix.RELEASE_FILE_NAME }}
- name: Upload Asset
uses: actions/upload-artifact@v4
with:
name: exe-${{ matrix.RELEASE_FILE_NAME }}
path: ./dist/${{ matrix.RELEASE_FILE_NAME }}
if-no-files-found: error

pre-release:
if: startsWith(github.ref, 'refs/heads/')
name: "Pre Release"
runs-on: "ubuntu-latest"
needs: [ test, build-exe ]
permissions:
contents: write

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Download exe
uses: actions/download-artifact@v4
with:
path: dist
pattern: exe-*
merge-multiple: true

- name: Release
uses: softprops/action-gh-release@v2
with:
name: "Development Build"
tag_name: latest
prerelease: true
fail_on_unmatched_files: true
generate_release_notes: true
files: |
dist/shadycompass_${{github.ref_name}}_linux_amd64
dist/shadycompass_${{github.ref_name}}_macos
dist/shadycompass_${{github.ref_name}}.exe
release:
if: startsWith(github.ref, 'refs/tags/')
name: "Release"
runs-on: "ubuntu-latest"
needs: [ test, build-exe ]
permissions:
contents: write

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Download exe
uses: actions/download-artifact@v4
with:
path: dist
pattern: exe-*
merge-multiple: true

- name: Release
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
files: |
dist/shadycompass_${{github.ref_name}}_linux_amd64
dist/shadycompass_${{github.ref_name}}_macos
dist/shadycompass_${{github.ref_name}}.exe
88 changes: 0 additions & 88 deletions .github/workflows/exe.yaml

This file was deleted.

0 comments on commit f77c3a8

Please sign in to comment.