Skip to content

Commit

Permalink
pipelines
Browse files Browse the repository at this point in the history
  • Loading branch information
gcormier committed Dec 1, 2022
1 parent 6a8a233 commit 06a934b
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 31 deletions.
26 changes: 13 additions & 13 deletions .github/workflows/fab_outputs.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: "FABrication Output"
name: "PCB Fabrication"
on:
push:
paths:
- 'PCB/**'
- 'pcb/**'
tags:
- pcb-v*
workflow_dispatch:
Expand All @@ -11,38 +11,38 @@ on:
jobs:
FabricationOutputs:
env:
BaseFileName: megadesk
Timezone: America/New_york
BaseFileName: ${{ github.event.repository.name }}
Timezone: America/Toronto
OutputFolder: PCB/KiBotOutput
runs-on: ubuntu-latest

steps:
# Check out the files
- uses: actions/checkout@v3
- uses: actions/checkout@v2

# Get the current date and time, in the timezone specified above, for use later.
- name: Get current date and time
id: date
run: echo "date=$(TZ='${{ env.Timezone }}' date +'%Y-%m-%d %T')" >> $GITHUB_OUTPUT
run: echo "::set-output name=date::$(TZ='${{ env.Timezone }}' date +'%Y-%m-%d %T')"

# Get the current date
- name: Get current date
id: date_only
run: echo "date_only=$(TZ='${{ env.Timezone }}' date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
run: echo "::set-output name=date_only::$(TZ='${{ env.Timezone }}' date +'%Y-%m-%d')"

# Actually run KiBot to generate all the files. The KiBot script used is
# in the .kibot/release.kibot.yaml folder.
- name: KiBot
uses: INTI-CMNB/KiBot@v2_k6
with:
config: PCB/.kibot/megadesk.kibot.yaml
config: pcb/.kibot/kibot.yaml
dir: ${{ env.OutputFolder }}
schema: PCB/megadesk.kicad_sch
board: PCB/megadesk.kicad_pcb
schema: pcb/${{ env.BaseFileName }}.kicad_sch
board: pcb/${{ env.BaseFileName }}.kicad_pcb

# Archive all the artifacts from output and attach to the action's results.
- name: Archive production artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v2
with:
name: ${{ env.BaseFileName }}-fab-${{ steps.date_only.outputs.date_only }}
path: ${{ env.OutputFolder }}/**
Expand Down
46 changes: 28 additions & 18 deletions .github/workflows/firmware_build.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
name: "Firmware builds"
name: "Firmware build"
on:
push:
paths:
- 'Code/**'
- 'code/**'
tags:
- v*
workflow_dispatch:

jobs:
build:
env:
BaseFileName: megadesk
Timezone: America/New_york
BaseFileName: ${{ github.event.repository.name }}
Timezone: America/Toronto
OutputFolder: build

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v2

- name: Create build folder
run: |
mkdir $OutputFolder
- name: Install pyhon
uses: actions/setup-python@v3
uses: actions/setup-python@v2

- name: Install pio
run: |
Expand All @@ -33,53 +33,63 @@ jobs:
# Get the current date and time, in the timezone specified above, for use later.
- name: Get current date and time
id: date
run: echo "date=$(TZ='${{ env.Timezone }}' date +'%Y-%m-%d %T')" >> $GITHUB_OUTPUT
run: echo "::set-output name=date::$(TZ='${{ env.Timezone }}' date +'%Y-%m-%d %T')"

# Get the current date
- name: Get current date
id: date_only
run: echo "date_only=$(TZ='${{ env.Timezone }}' date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
run: echo "::set-output name=date_only::$(TZ='${{ env.Timezone }}' date +'%Y-%m-%d')"



- name: Build t841 noserial
run: pio run --project-dir ./Code --environment attiny841_noserial
run: pio run --project-dir ./code --environment attiny841_noserial
- name: Rename t841 noserial firmware
run: |
mv ./Code/.pio/build/attiny841_noserial/firmware.hex $OutputFolder/$BaseFileName-$GITHUB_REF_NAME-t841-noserial.hex
mv ./code/.pio/build/attiny841_noserial/firmware.hex $OutputFolder/$BaseFileName-$GITHUB_REF_NAME-t841-noserial.hex
FILENAME1=$OutputFolder/$BaseFileName-$GITHUB_REF_NAME-t841-noserial.hex
echo "FILENAME1=$FILENAME1" >> $GITHUB_ENV
- name: Build t841 serial
run: pio run --project-dir ./Code --environment attiny841_serial
run: pio run --project-dir ./code --environment attiny841_serial
- name: Rename t841 serial firmware
run: |
mv ./Code/.pio/build/attiny841_serial/firmware.hex $OutputFolder/$BaseFileName-$GITHUB_REF_NAME-t841-serial.hex
mv ./code/.pio/build/attiny841_serial/firmware.hex $OutputFolder/$BaseFileName-$GITHUB_REF_NAME-t841-serial.hex
FILENAME2=$OutputFolder/$BaseFileName-$GITHUB_REF_NAME-t841-serial.hex
echo "FILENAME2=$FILENAME2" >> $GITHUB_ENV
- name: Build t1624 noserial
run: pio run --project-dir ./Code --environment attiny1624_noserial
run: pio run --project-dir ./code --environment attiny1624_noserial
- name: Rename t1624 noserial firmware
run: |
mv ./Code/.pio/build/attiny1624_noserial/firmware.hex $OutputFolder/$BaseFileName-$GITHUB_REF_NAME-t1624-noserial.hex
mv ./code/.pio/build/attiny1624_noserial/firmware.hex $OutputFolder/$BaseFileName-$GITHUB_REF_NAME-t1624-noserial.hex
FILENAME3=$OutputFolder/$BaseFileName-$GITHUB_REF_NAME-t1624-noserial.hex
echo "FILENAME3=$FILENAME3" >> $GITHUB_ENV
- name: Build t1624 serial
run: pio run --project-dir ./Code --environment attiny1624_serial
run: pio run --project-dir ./code --environment attiny1624_serial
- name: Rename t1624 serial firmware
run: |
mv ./Code/.pio/build/attiny1624_serial/firmware.hex $OutputFolder/$BaseFileName-$GITHUB_REF_NAME-t1624-serial.hex
mv ./code/.pio/build/attiny1624_serial/firmware.hex $OutputFolder/$BaseFileName-$GITHUB_REF_NAME-t1624-serial.hex
FILENAME4=$OutputFolder/$BaseFileName-$GITHUB_REF_NAME-t1624-serial.hex
echo "FILENAME4=$FILENAME4" >> $GITHUB_ENV
- name: Archive production artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v2
with:
name: ${{ env.BaseFileName}}-firmware-${{ steps.date_only.outputs.date_only }}
path: ${{ env.OutputFolder }}/**



- name: Display environment variables
run: |
echo "$GITHUB_CONTEXT"
echo "$GITHUB_ENV"
# Conditional release if it was tagged with v*
- name: Release
uses: softprops/action-gh-release@v1
Expand Down

0 comments on commit 06a934b

Please sign in to comment.