Skip to content

Commit 0369ef5

Browse files
release: fix missing ruby and licensee dep (#486)
Co-authored-by: Luca Rinaldi <lucarin@protonmail.com>
1 parent ca05002 commit 0369ef5

File tree

6 files changed

+88188
-17
lines changed

6 files changed

+88188
-17
lines changed
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/check-license.md
2+
name: Check License
3+
4+
env:
5+
EXPECTED_LICENSE_FILENAME: LICENSE
6+
# SPDX identifier: https://spdx.org/licenses/
7+
EXPECTED_LICENSE_TYPE: GPL-3.0
8+
9+
# See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows
10+
on:
11+
push:
12+
paths:
13+
- ".github/workflows/check-license.ya?ml"
14+
# See: https://github.com/licensee/licensee/blob/master/docs/what-we-look-at.md#detecting-the-license-file
15+
- "[cC][oO][pP][yY][iI][nN][gG]*"
16+
- "[cC][oO][pP][yY][rR][iI][gG][hH][tH]*"
17+
- "[lL][iI][cC][eE][nN][cCsS][eE]*"
18+
- "[oO][fF][lL]*"
19+
- "[pP][aA][tT][eE][nN][tT][sS]*"
20+
pull_request:
21+
paths:
22+
- ".github/workflows/check-license.ya?ml"
23+
- "[cC][oO][pP][yY][iI][nN][gG]*"
24+
- "[cC][oO][pP][yY][rR][iI][gG][hH][tH]*"
25+
- "[lL][iI][cC][eE][nN][cCsS][eE]*"
26+
- "[oO][fF][lL]*"
27+
- "[pP][aA][tT][eE][nN][tT][sS]*"
28+
workflow_dispatch:
29+
repository_dispatch:
30+
31+
jobs:
32+
check-license:
33+
runs-on: ubuntu-latest
34+
35+
steps:
36+
- name: Checkout repository
37+
uses: actions/checkout@v4
38+
39+
- name: Install Ruby
40+
uses: ruby/setup-ruby@v1
41+
with:
42+
ruby-version: ruby # Install latest version
43+
44+
- name: Install Task
45+
uses: arduino/setup-task@v2
46+
with:
47+
repo-token: ${{ secrets.GITHUB_TOKEN }}
48+
version: 3.x
49+
50+
- name: Install licensee
51+
run: gem install licensee
52+
53+
- name: Check license file
54+
run: |
55+
EXIT_STATUS=0
56+
# See: https://github.com/licensee/licensee
57+
LICENSEE_OUTPUT="$(licensee detect --json --confidence=100)"
58+
59+
DETECTED_LICENSE_FILE="$(echo "$LICENSEE_OUTPUT" | jq .matched_files[0].filename | tr --delete '\r')"
60+
echo "Detected license file: $DETECTED_LICENSE_FILE"
61+
if [ "$DETECTED_LICENSE_FILE" != "\"${EXPECTED_LICENSE_FILENAME}\"" ]; then
62+
echo "::error file=${DETECTED_LICENSE_FILE}::detected license file $DETECTED_LICENSE_FILE doesn't match expected: $EXPECTED_LICENSE_FILENAME"
63+
EXIT_STATUS=1
64+
fi
65+
66+
DETECTED_LICENSE_TYPE="$(echo "$LICENSEE_OUTPUT" | jq .matched_files[0].matched_license | tr --delete '\r')"
67+
echo "Detected license type: $DETECTED_LICENSE_TYPE"
68+
if [ "$DETECTED_LICENSE_TYPE" != "\"${EXPECTED_LICENSE_TYPE}\"" ]; then
69+
echo "::error file=${DETECTED_LICENSE_FILE}::detected license type $DETECTED_LICENSE_TYPE doesn't match expected \"${EXPECTED_LICENSE_TYPE}\""
70+
EXIT_STATUS=1
71+
fi
72+
73+
exit $EXIT_STATUS
74+
75+
- name: Check debian copyright file
76+
run: |
77+
task update-deb-copyright
78+
git diff --color --exit-code

.github/workflows/release.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,6 @@ jobs:
6969
tar -czvf ./build/${{ env.PROJECT_NAME }}-${TAG_VERSION}-${{ matrix.platform-name }}-${{ matrix.arch }}.tar.gz -C ./build ${{ env.PROJECT_NAME }}
7070
rm ./build/${{ env.PROJECT_NAME }}
7171
72-
- name: Update deb copyright
73-
if: matrix.platform-name == 'linux'
74-
run: |
75-
task update-deb-copyright
76-
7772
- name: Build deb
7873
if: matrix.platform-name == 'linux'
7974
run: |

.licensed.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,12 @@ apps:
99
cache_path: .licenses/arduino-app-cli
1010
include_sources:
1111
- go
12-
notices:
13-
output: licenses/arduino-app-cli-NOTICE
1412

1513
- name: arduino-router
1614
source_path: ./cmd/arduino-router
1715
cache_path: .licenses/arduino-router
1816
include_sources:
1917
- go
20-
notices:
21-
output: licenses/arduino-router-NOTICE
2218

2319
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-dependencies/GPL-3.0/.licensed.yml
2420
allowed:

Taskfile.yml

Lines changed: 39 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -347,9 +347,42 @@ tasks:
347347
echo "Installing Ruby gem: licensed"
348348
gem install licensed
349349
fi
350-
- licensed cache
351-
- licensed notices
352-
- echo -e "\n\n---\n\n" >> debian/arduino-app-cli/usr/share/doc/arduino-app-cli/copyright
353-
- cat .licenses/arduino-app-cli/NOTICE >> debian/arduino-app-cli/usr/share/doc/arduino-app-cli/copyright
354-
- echo -e "\n\n---\n\n" >> debian/arduino-router/usr/share/doc/arduino-router/copyright
355-
- cat .licenses/arduino-router/NOTICE >> debian/arduino-router/usr/share/doc/arduino-router/copyright
350+
licensed cache
351+
licensed notices
352+
cat > debian/arduino-app-cli/usr/share/doc/arduino-app-cli/copyright <<EOF
353+
Copyright 2025 ARDUINO SA (http://www.arduino.cc/)
354+
355+
This software is released under the GNU General Public License version 3,
356+
which covers the main part of arduino-app-cli.
357+
The terms of this license can be found at:
358+
https://www.gnu.org/licenses/gpl-3.0.en.html
359+
360+
You can be released from the requirements of the above licenses by purchasing
361+
a commercial license. Buying such a license is mandatory if you want to
362+
modify or otherwise use the software for commercial activities involving the
363+
Arduino software without disclosing the source code of your own applications.
364+
To purchase a commercial license, send an email to license@arduino.cc.
365+
366+
---
367+
368+
EOF
369+
cat .licenses/arduino-app-cli/NOTICE >> debian/arduino-app-cli/usr/share/doc/arduino-app-cli/copyright
370+
371+
cat > debian/arduino-router/usr/share/doc/arduino-router/copyright <<EOF
372+
Copyright 2025 ARDUINO SA (http://www.arduino.cc/)
373+
374+
This software is released under the GNU General Public License version 3,
375+
which covers the main part of arduino-router.
376+
The terms of this license can be found at:
377+
https://www.gnu.org/licenses/gpl-3.0.en.html
378+
379+
You can be released from the requirements of the above licenses by purchasing
380+
a commercial license. Buying such a license is mandatory if you want to
381+
modify or otherwise use the software for commercial activities involving the
382+
Arduino software without disclosing the source code of your own applications.
383+
To purchase a commercial license, send an email to license@arduino.cc.
384+
385+
---
386+
387+
EOF
388+
cat .licenses/arduino-router/NOTICE >> debian/arduino-router/usr/share/doc/arduino-router/copyright

0 commit comments

Comments
 (0)