Skip to content

Commit

Permalink
Merge a3477ea into 6327038
Browse files Browse the repository at this point in the history
  • Loading branch information
mathbrook authored Feb 16, 2024
2 parents 6327038 + a3477ea commit d02fe9f
Show file tree
Hide file tree
Showing 13 changed files with 495 additions and 60 deletions.
219 changes: 219 additions & 0 deletions .github/workflows/build-all.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,219 @@
name: build and run executables

on:
push:
branches: "main"
pull_request:
branches: "main"

jobs:
build-linux:

runs-on: ubuntu-latest

steps:
- name: checkout code
uses: actions/checkout@v2

- name: Get current date and time
id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%dT%H_%M_%S')"
# - name: Release
# uses: softprops/action-gh-release@v1
# with:
# tag_name: ${{ github.ref_name }}-${{ steps.date.outputs.date }}
# files: ./*

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.8' # Replace '3.x' with your Python version

- name: install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: get dbc from latest release
uses: pozetroninc/github-action-get-latest-release@master
with:
repository: KSU-MS/ksu-ms-dbc

- name: run pyinstaller
run: |
pyinstaller --onefile ./parser_exe.py
- name: check what files we cooked up
run: |
ls -R
cp -r ./test ./dist
cp ./dataPlots.m ./dist
- name: release-downloader
uses: robinraju/[email protected]
with:
repository:
KSU-MS/ksu-ms-dbc
latest: true
fileName: "*.dbc"
out-file-path: |
./dist/dbc-files
- name: upload artifacts
uses: actions/upload-artifact@v2
with:
name: parser-exe-linux
path: |
./build/*
./dist/*
- name: release all files
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ github.ref_name }}-${{ steps.date.outputs.date }}
files: |
./*
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 -r requirements.txt
pip freeze
- name: run pyinstaller
run: |
pyinstaller --onefile ./parser_exe.py
- name: copy test into dist folder
run: |
ls -r
mkdir .\dist\test
xcopy ".\test" ".\dist\test" /E
copy ".\dataPlots.m" ".\dist"
- name: release-downloader
uses: robinraju/[email protected]
with:
repository:
KSU-MS/ksu-ms-dbc
latest: true
fileName: "*.dbc"
out-file-path: |
./dist/dbc-files/
- name: upload artifacts
uses: actions/upload-artifact@v2
with:
name: parser-exe-windows
path: |
./dist/*
./build/*
./*.m

test-bin:
needs: build-linux
runs-on: ubuntu-latest
steps:
- name: download artifact
uses: actions/download-artifact@v2
with:
name: parser-exe-linux
path: parser-exe-download
- name: run executable
run: |
cd parser-exe-download
cd dist
chmod u+x ./parser_exe
./parser_exe -h
./parser_exe --getdbc --test -v
test-exe:
needs: build-windows
runs-on: windows-latest
steps:
- name: download artifact
uses: actions/download-artifact@v2
with:
name: parser-exe-windows
path: parser-exe-download
- name: run executable # watch the - and _ here lol
run: |
ls -r
cd parser-exe-download
cd dist
.\parser_exe.exe -h
.\parser_exe.exe --getdbc --test -v
create-exe-release:
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
needs: [test-bin,test-exe]
runs-on: ubuntu-latest
steps:
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.run_number }}
release_name: ${{ github.ref_name }}_release_${{ github.run_number }}
draft: false
prerelease: false

release-bin:
needs: [build-linux,test-bin,create-exe-release]
runs-on: ubuntu-latest
steps:

- name: download artifact
uses: actions/download-artifact@v2
with:
name: parser-exe-linux
path: parser-exe-download

- name: compress artifact
run: |
tar -czvf parser-exe-linux.tar.gz ./parser-exe-download
- name: Upload release asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-exe-release.outputs.upload_url }}
asset_path: ./parser-exe-linux.tar.gz
asset_name: parser_exe_linux.tar.gz
asset_content_type: application/zip

release-exe:
needs: [build-windows,test-exe,create-exe-release]
runs-on: windows-latest
steps:
- name: download artifact
uses: actions/download-artifact@v2
with:
name: parser-exe-windows
path: parser-exe-download

- name: compress artifact
run: |
tar -czvf parser-exe-windows.zip ./parser-exe-download
- name: Upload release asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-exe-release.outputs.upload_url }}
asset_path: ./parser-exe-windows.zip
asset_name: parser_exe_windows.zip
asset_content_type: application/zip

70 changes: 46 additions & 24 deletions .github/workflows/build-exe.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ name: build and run windows executable
on:
push:
branches: "main"
pull_request:
branches: "main"
# pull_request:
# branches: "main"

jobs:
build:
Expand All @@ -18,28 +18,7 @@ jobs:
# - name: Get current date and time
# id: date
# run: echo "::set-output name=date::$(date +'%Y-%m-%dT%H_%M_%S')"
# - name: Release
# uses: softprops/action-gh-release@v1
# with:
# tag_name: ${{ github.ref_name }}-${{ steps.date.outputs.date }}
# files: ./*

# - name: Set up Python
# uses: actions/setup-python@v2
# with:
# python-version: '3.8' # Replace '3.x' with your Python version

# - name: install dependencies
# run: |
# python -m pip install --upgrade pip
# pip install -r requirements.txt

# - name: run pyinstaller
# run: |
# pyinstaller --onefile ./parser_exe.py
# - name: check what files we cooked up
# run: |
# ls -R

- name: install dependencies
run: |
python -m pip install --upgrade pip
Expand All @@ -55,6 +34,7 @@ jobs:
ls -r
mkdir .\dist\test
xcopy ".\test" ".\dist\test" /E
copy ".\dataPlots.m" ".\dist"
- name: release-downloader
uses: robinraju/[email protected]
Expand All @@ -73,7 +53,15 @@ jobs:
path: |
./dist/*
./build/*
./*.m
# - name: release all files
# uses: softprops/action-gh-release@v1
# with:
# tag_name: ${{ github.ref_name }}-${{ steps.date.outputs.date }}
# files: |
# ./*

test-exe:
needs: build
runs-on: windows-latest
Expand All @@ -98,3 +86,37 @@ jobs:
# path: |
# ./build/*
# ./dist/parser_exe
release-exe:
needs: [build,test-exe]
runs-on: windows-latest
steps:
- name: download artifact
uses: actions/download-artifact@v2
with:
name: parser-exe-windows
path: parser-exe-download
- name: compress artifact
run: |
tar -czvf parser-exe-windows.zip ./parser-exe-download
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.run_number }}
release_name: ${{ github.ref_name }}_release_windows_${{ github.run_number }}
draft: false
prerelease: false

- name: 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: ./parser-exe-windows.zip
asset_name: parser_exe_windows.zip
asset_content_type: application/zip

Loading

0 comments on commit d02fe9f

Please sign in to comment.