-
Notifications
You must be signed in to change notification settings - Fork 2
56 lines (54 loc) · 1.65 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: KiCad Project Build and Release
on:
push:
tags:
- '*'
jobs:
build:
runs-on: ubuntu-22.04
permissions:
contents: write
name: KiCad Project Build and Release
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Add KiCad Repository
run: |
sudo add-apt-repository ppa:kicad/kicad-8.0-releases
sudo apt update
- name: Cache Required Packages
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: cmake ninja-build kicad kicad-library-all
version: 1.0
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- run: pip install frugy
- name: Extract Tag Base Name
id: get_tag
run: |
TAG_NAME=${GITHUB_REF#refs/tags/}
BASE_NAME=${TAG_NAME%_*}
echo "Full tag name: $TAG_NAME"
echo "Base name: $BASE_NAME"
echo "TAG_BASE_NAME=$BASE_NAME" >> $GITHUB_ENV
- name: Build and Validate KiCad Project
run: |
PROJECT_DIRS=$TAG_BASE_NAME
for DIR in $PROJECT_DIRS; do
echo "Processing directory: $DIR"
pushd ${{github.workspace}}/$DIR
cmake -B ./build -G Ninja
cmake --build ./build
find ./build -maxdepth 1 -name "*.pdf" -exec cp {} ${{github.workspace}}/ \;
find ./build -maxdepth 1 -name "*.zip" -exec cp {} ${{github.workspace}}/ \;
find ./build -maxdepth 1 -name "*.bin" -exec cp {} ${{github.workspace}}/ \;
popd
done
- name: Create Release
uses: ncipollo/release-action@v1
with:
artifacts: "*.pdf,*.zip,*.bin"