-
Notifications
You must be signed in to change notification settings - Fork 0
116 lines (95 loc) · 3.75 KB
/
release.yaml
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
name: Release
on:
release:
types: [published]
jobs:
build:
runs-on: windows-latest
timeout-minutes: 15
env:
SONAR_SCANNER_VERSION: 4.4.0.2170
SONAR_SERVER_URL: "https://sonarcloud.io"
BUILD_WRAPPER_OUT_DIR: out
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 17
- name: Setup sonar-scanner
env:
SONAR_SCANNER_DOWNLOAD_URL: https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-${{ env.SONAR_SCANNER_VERSION }}-windows.zip
run: |
New-Item -Force -ItemType directory -Path $HOME\.sonar
curl -sSLo $HOME\.sonar\sonar-scanner.zip ${{ env.SONAR_SCANNER_DOWNLOAD_URL }}
unzip -o $HOME\.sonar\sonar-scanner.zip -d $HOME\.sonar\
echo "$HOME\.sonar\sonar-scanner-${{ env.SONAR_SCANNER_VERSION }}-windows\bin" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
- name: Setup build-wrapper
env:
BUILD_WRAPPER_DOWNLOAD_URL: ${{ env.SONAR_SERVER_URL }}/static/cpp/build-wrapper-win-x86.zip
run: |
curl -sSLo $HOME\.sonar\build-wrapper.zip ${{ env.BUILD_WRAPPER_DOWNLOAD_URL }}
unzip -o $HOME\.sonar\build-wrapper.zip -d $HOME\.sonar\
echo "$HOME\.sonar\build-wrapper-win-x86" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8
- name: Build
run: |
build-wrapper-win-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} make
- name: Run sonar-scanner
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
sonar-scanner --define sonar.host.url="${{ env.SONAR_SERVER_URL }}" --define sonar.cfamily.build-wrapper-output="${{ env.BUILD_WRAPPER_OUT_DIR }}"
- name: Upload build-wrapper-dump
uses: actions/upload-artifact@v2
with:
name: build-wrapper-dump
path: ${{ env.BUILD_WRAPPER_OUT_DIR }}/build-wrapper-dump.json
- name: Upload mainboard
uses: actions/upload-artifact@v2
with:
name: sketches
path: out/Mainboard/Mainboard.ino.bin
- name: Extract files
run: 7z e ${env:GITHUB_WORKSPACE}/out/Bluetooth/Bluetooth.ino.zip -o"${env:GITHUB_WORKSPACE}/out/Bluetooth"
- name: Upload bluetooth
uses: actions/upload-artifact@v2
with:
name: sketches
path: out/Bluetooth/Bluetooth.ino.bin
package:
runs-on: windows-latest
timeout-minutes: 15
needs: build
steps:
- name: Checkout packager
uses: actions/checkout@v2
with:
repository: microsoft/uf2
path: uf2
- name: Setup Python
uses: actions/setup-python@v2
- name: Download sketches
uses: actions/download-artifact@v2
with:
name: sketches
path: bin
# The values passed into the script need to be retrieved from the following page:
# See: https://learn.adafruit.com/adafruit-feather-m4-express-atsamd51/uf2-bootloader-details
- name: Package mainboard
run: python uf2/utils/uf2conv.py -c -b 0x4000 -o ${env:GITHUB_WORKSPACE}/mainboard.uf2 ${env:GITHUB_WORKSPACE}/bin/Mainboard.ino.bin
# The values passed into the script need to be retrieved from the following page:
# See: https://github.com/adafruit/Adafruit_nRF52_Bootloader
- name: Package bluetooth
run: python uf2/utils/uf2conv.py -c -b 0x26000 -f 0xADA52840 -o ${env:GITHUB_WORKSPACE}/bluetooth.uf2 ${env:GITHUB_WORKSPACE}/bin/Bluetooth.ino.bin
- name: Upload mainboard
uses: actions/upload-artifact@v2
with:
name: mainboard
path: mainboard.uf2
- name: Upload bluetooth
uses: actions/upload-artifact@v2
with:
name: bluetooth
path: bluetooth.uf2