Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve "Build Binaries" and "Build Test" GitHub Actions #1463

Merged
merged 9 commits into from
Jan 7, 2021
28 changes: 22 additions & 6 deletions .github/workflows/buildBinary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,19 @@ name: Build Binaries
on:
push:
branches: [ master ]
paths-ignore:
- .devcontainer/**
- .github/**
- Bootloader/**
- Copy to SD Card root directory to update/**
- images/**
- readme/**
- '**/*.md'

jobs:
main:
name: Main
name: Build Binaries
if: github.repository == 'bigtreetech/BIGTREETECH-TouchScreenFirmware'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
Expand Down Expand Up @@ -48,14 +58,20 @@ jobs:
run: platformio run --environment MKS_32_V1_4_NOBL
- name: Build MKS TFT28 V1.0
run: platformio run --environment MKS_28_V1_0
- name: Clean Up Folder
- name: Remove Old Binaries
run: find "Copy to SD Card root directory to update/" -name '*.bin' -print -delete
- name: Copy Files
- name: Remove Old Config
run: find "Copy to SD Card root directory to update/" -name 'config.ini' -print -delete
- name: Copy New Binaries
run: find .pio/build/ -name '*.bin' -exec cp -vf '{}' "./Copy to SD Card root directory to update/" ";"
- name: Stage Changes
run: git config user.email "actions@example.com" && git config user.name "Github Actions" && find "Copy to SD Card root directory to update/" -name '*.bin' -exec git add {} \;
- name: Copy New Config
run: find TFT/src/User/ -name 'config.ini' -exec cp -vf '{}' "./Copy to SD Card root directory to update/" ";"
- name: Stage New Binaries
run: git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" && git config user.name "${GITHUB_ACTOR}" && find "Copy to SD Card root directory to update/" -name '*.bin' -exec git add {} \;
- name: Stage New Config
run: git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" && git config user.name "${GITHUB_ACTOR}" && find "Copy to SD Card root directory to update/" -name 'config.ini' -exec git add {} \;
- name: Push
uses: actions-x/commit@v2
with:
message: Update prebuilt binaries
message: Update prebuilt binaries and config
token: ${{ secrets.MY_SECRET_TOKEN }}
19 changes: 17 additions & 2 deletions .github/workflows/buildTest.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,24 @@
name: Build Test
on: [pull_request, push]
on:
pull_request:
paths-ignore:
- Bootloader/**
- Copy to SD Card root directory to update/**
- images/**
- readme/**
- '**/*.md'

push:
paths-ignore:
- Bootloader/**
- Copy to SD Card root directory to update/**
- images/**
- readme/**
- '**/*.md'

jobs:
main:
name: Main
name: Build Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
Expand Down