forked from mathbrook/KS5e-Data-Logging
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
495 additions
and
60 deletions.
There are no files selected for viewing
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
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 | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,8 +3,8 @@ name: build and run windows executable | |
on: | ||
push: | ||
branches: "main" | ||
pull_request: | ||
branches: "main" | ||
# pull_request: | ||
# branches: "main" | ||
|
||
jobs: | ||
build: | ||
|
@@ -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 | ||
|
@@ -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] | ||
|
@@ -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 | ||
|
@@ -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 | ||
|
Oops, something went wrong.