Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 19 additions & 6 deletions .github/workflows/makefile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,25 @@ on:
branches:
- 'main'
pull_request:
types: [opened, reopened]
types: [opened, reopened, synchronize]
branches:
- 'main'

env:
SW_VER: develop

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Sets env vars for PR
run: |
echo "SW_VER=${{ github.ref_name }}" >> $GITHUB_ENV
if: startsWith(github.ref, 'refs/tags')

- name: display version
run: |
echo "Building ${{env.SW_VER}}"

- name: Checkout kastle2
uses: actions/checkout@v6
Expand Down Expand Up @@ -42,12 +53,14 @@ jobs:
./configure.sh

- name: Build Project
run: make -C ${{github.workspace}}/kastle2/code/build
run: |
echo ${{github.ref_name}}
make -C ${{github.workspace}}/kastle2/code/build

- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: build-${{github.ref_name}}
name: build-${{env.SW_VER}}
path: kastle2/code/build/output/*.uf2

- name: Publish firmware to kastle2-webapps
Expand All @@ -69,12 +82,12 @@ jobs:
#mkdir -p kastle2-webapps/wave-bard-sample-loader/public/firmwares

# Copy firmware with version (branch name)
cp kastle2/code/build/output/kastle2-wave-bard.uf2 "kastle2-webapps/wave-bard-sample-loader/public/firmwares/kastle2-wave-bard-${{ github.ref_name }}-no-samples.uf2"
cp kastle2/code/build/output/kastle2-wave-bard.uf2 "kastle2-webapps/wave-bard-sample-loader/public/firmwares/kastle2-wave-bard-${{ env.SW_VER }}-no-samples.uf2"

# Change to webapps directory and commit
cd kastle2-webapps
git add "wave-bard-sample-loader/public/firmwares/kastle2-wave-bard-${{ github.ref_name }}-no-samples.uf2"
git commit -m "Update wave-bard firmware from ${{ github.ref_name }} branch (commit ${{ github.sha }})"
git add "wave-bard-sample-loader/public/firmwares/kastle2-wave-bard-${{ env.SW_VER }}-no-samples.uf2"
git commit -m "Update wave-bard firmware from ${{ env.SW_VER }} branch (commit ${{ github.sha }})"
git push

- name: release
Expand Down
6 changes: 6 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@
"options": {
"cwd": "${workspaceRoot}/code/build"
},
"dependsOn": [
"configure"
],
"presentation": {
"clear": true,
"showReuseMessage": false,
Expand All @@ -127,6 +130,9 @@
"options": {
"cwd": "${workspaceRoot}/code/build"
},
"dependsOn": [
"configure"
],
"presentation": {
"clear": true,
"showReuseMessage": false,
Expand Down
Loading