cleanup #22
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
name: Build | |
on: | |
workflow_dispatch: # can be triggered manually | |
pull_request: | |
push: # automatically run on changes to following paths | |
paths: | |
- "**.lock" | |
- "config/**" | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Calculate metadata | |
id: data | |
run: | | |
# Calculate | |
full="${{ github.sha }}" | |
short="${full:0:6}" | |
date="$(date --utc +'%Y-%m-%d_%H-%M-%S')" | |
# Print to output | |
echo "full=$full" >> $GITHUB_OUTPUT | |
echo "short=$short" >> $GITHUB_OUTPUT | |
echo "date=$date" >> $GITHUB_OUTPUT | |
echo "name_suffix=_${date}_${short}" >> $GITHUB_OUTPUT | |
# Print to stdout too | |
echo Metadata: | |
cat $GITHUB_OUTPUT | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install nix | |
uses: cachix/install-nix-action@v25 | |
- name: Setup nix cache | |
uses: DeterminateSystems/magic-nix-cache-action@main | |
- name: Build Glove80 firmware | |
run: nix build | |
- name: Upload | |
uses: actions/upload-artifact@v4 | |
with: | |
name: glove80${{ steps.data.outputs.name_suffix }}.uf2 | |
path: result/glove80.uf2 |