Skip to content

Commit

Permalink
Merge pull request #9 from danil-tolkachev/vial
Browse files Browse the repository at this point in the history
CI/CD for ergohaven firmware
  • Loading branch information
kissetfall authored Mar 18, 2024
2 parents 05d376c + 9cddf71 commit 61996f4
Show file tree
Hide file tree
Showing 3 changed files with 126 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/build-ergohaven.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Build Ergohaven

on:
workflow_call:
workflow_dispatch:
pull_request:

jobs:

build-ergohaven:
name: Build Ergohaven keymaps
runs-on: ubuntu-latest
container: ghcr.io/qmk/qmk_cli

steps:
- name: (actions) Checkout Vial repo
uses: actions/checkout@v3
with:
persist-credentials: false
submodules: recursive

- name: Build
id: build
run: |
git config --global --add safe.directory $(pwd)
qmk compile -kb ergohaven/k03 -km no-enc
qmk compile -kb ergohaven/k03 -km enc-left
qmk compile -kb ergohaven/k03 -km enc-right
qmk compile -kb ergohaven/k03 -km enc-left-right
qmk compile -kb ergohaven/velvet/rev1 -km v1
qmk compile -kb ergohaven/velvet -km v2
qmk compile -kb ergohaven/hpd -km v1
qmk compile -kb ergohaven/k02 -km v1
qmk compile -kb ergohaven/remnant -km v1
qmk compile -kb ergohaven/planeta/rev1 -km v1
qmk compile -kb ergohaven/planeta -km v2
qmk compile -kb ergohaven/planeta -km hid
# qmk compile -kb ergohaven/macropad -km v1
- uses: actions/upload-artifact@v4
name: Upload
id: upload
with:
path: .build/*.uf2
name: ergohaven_fw
36 changes: 36 additions & 0 deletions .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Pre-Release

on:
push:
branches: ['vial']

jobs:

build-ergohaven:
uses: ./.github/workflows/build-ergohaven.yml

pre-release:
name: Pre-Release
needs:
- build-ergohaven
runs-on: ubuntu-latest
permissions:
contents: 'write'
packages: 'write'
pull-requests: 'read'

steps:
- name: Download
uses: actions/download-artifact@v4
with:
path: ergohaven_fw

- name: Create Release
uses: marvinpinto/action-automatic-releases@latest
with:
repo_token: '${{ secrets.GITHUB_TOKEN }}'
automatic_release_tag: 'latest'
prerelease: true
title: 'Latest Build'
files: |
ergohaven_fw/**/*.uf2
45 changes: 45 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Release

on:
push:
tags:
- "*"

jobs:

build-ergohaven:
uses: ./.github/workflows/build-ergohaven.yml

pre-release:
name: Pre-Release
needs:
- build-ergohaven
runs-on: ubuntu-latest
permissions:
contents: 'write'
packages: 'write'
pull-requests: 'read'

steps:
- name: Download
uses: actions/download-artifact@v4
with:
path: ergohaven_fw

- uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: rename
version: 1.0

- name: Rename
run: |
cd ergohaven_fw/ergohaven_fw
rename 's/(rev1_|rev2_)//; s/ergohaven_/'${GITHUB_REF_NAME}'_'/ *.uf2
- name: Create Release
uses: marvinpinto/action-automatic-releases@latest
with:
repo_token: '${{ secrets.GITHUB_TOKEN }}'
prerelease: false
files: |
ergohaven_fw/**/*.uf2

0 comments on commit 61996f4

Please sign in to comment.