-
Notifications
You must be signed in to change notification settings - Fork 6
131 lines (123 loc) · 3.84 KB
/
build.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
on:
push:
pull_request:
permissions:
contents: write
env:
SKIP_RISCV: 0
SKIP_OPENOCD: 0
jobs:
build_windows:
name: Build Windows
# runs-on: [self-hosted, Windows, x64]
runs-on: 'windows-latest'
steps:
- name: Checkout
uses: actions/checkout@v4
# - name: Setup SSH Auth
# if: runner.environment == 'github-hosted'
# uses: webfactory/[email protected]
# with:
# ssh-private-key: ${{ secrets.SSH_KEY }}
- name: Setup MSYS2
uses: msys2/setup-msys2@v2
- name: Build
run: |
subst P: .
P:
./build.ps1 ./config/x64-win.json -SkipSigning -MSYS2Path (msys2 -c 'cygpath -m /').TrimEnd('\/')
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: tools-x64-win
path: |
bin/picotool-*-x64-win.zip
bin/pico-sdk-tools-*-x64-win.zip
bin/openocd-*-x64-win.zip
bin/riscv-toolchain-*-x64-win.zip
- name: Add Release Asset
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
bin/picotool-*-x64-win.zip
bin/pico-sdk-tools-*-x64-win.zip
bin/openocd-*-x64-win.zip
bin/riscv-toolchain-*-x64-win.zip
build_macos:
name: Build MacOS
# runs-on: [self-hosted, macOS]
runs-on: 'macos-latest'
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Homebrew
if: runner.environment == 'github-hosted'
id: set-up-homebrew
uses: Homebrew/actions/setup-homebrew@master
- name: Set up x86_64 Homebrew
if: runner.environment == 'github-hosted'
run: |
NONINTERACTIVE=1 arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
- name: Setup SSH Auth
if: runner.environment == 'github-hosted'
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SSH_KEY }}
- name: Build
run: ./build_macos.sh
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: tools-mac
path: |
bin/picotool-*-mac.zip
bin/pico-sdk-tools-*-mac.zip
bin/openocd-*-mac.zip
bin/riscv-toolchain-*.zip
- name: Add Release Asset
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
bin/picotool-*-mac.zip
bin/pico-sdk-tools-*-mac.zip
bin/openocd-*-mac.zip
bin/riscv-toolchain-*.zip
build_linux:
name: Build Linux
# strategy:
# matrix:
# os: [[self-hosted, linux, x64], [self-hosted, linux, arm64]]
strategy:
matrix:
os: [ubuntu-latest, [self-hosted, linux, arm64]]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup SSH Auth
if: runner.environment == 'github-hosted'
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SSH_KEY }}
- name: Build
run: ./build_linux.sh
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: tools-lin-${{ runner.arch }}
path: |
bin/picotool-*-lin.tar.gz
bin/pico-sdk-tools-*-lin.tar.gz
bin/openocd-*-lin.tar.gz
bin/riscv-toolchain-*-lin.tar.gz
- name: Add Release Asset
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
bin/picotool-*-lin.tar.gz
bin/pico-sdk-tools-*-lin.tar.gz
bin/openocd-*-lin.tar.gz
bin/riscv-toolchain-*-lin.tar.gz