Skip to content

Commit 629e90b

Browse files
committed
extract and pack licens
1 parent 699ddc0 commit 629e90b

File tree

3 files changed

+62
-2
lines changed

3 files changed

+62
-2
lines changed

.github/workflows/release-go-task.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,12 @@ jobs:
6565
with:
6666
repo-token: ${{ secrets.GITHUB_TOKEN }}
6767
version: 3.x
68-
68+
69+
- name: Build License
70+
run: |
71+
task extract-licenses
72+
task append-license
73+
6974
- name: Build
7075
run: task dist:${{ matrix.env.os }}
7176

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// This file is part of arduino-cli.
2+
//
3+
// Copyright $Year $Holder
4+
//
5+
// This software is released under the GNU General Public License version 3,
6+
// which covers the main part of arduino-cli.
7+
// The terms of this license can be found at:
8+
// https://www.gnu.org/licenses/gpl-3.0.en.html
9+
//
10+
// You can be released from the requirements of the above licenses by purchasing
11+
// a commercial license. Buying such a license is mandatory if you want to
12+
// modify or otherwise use the software for commercial activities involving the
13+
// Arduino software without disclosing the source code of your own applications.
14+
// To purchase a commercial license, send an email to [email protected].
15+
16+

Taskfile.yml

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,47 @@ version: "3"
22

33
includes:
44
dist: ./DistTasks.yml
5-
5+
66
tasks:
7+
extract-licenses:
8+
desc: Extract project and dependency licenses into debian copyright
9+
cmds:
10+
- |
11+
if ! command -v licensed >/dev/null; then
12+
echo "Installing Ruby gem: licensed"
13+
gem install licensed
14+
fi
15+
- |
16+
if [ ! -f .licensed.yml ]; then
17+
licensed init || true
18+
fi
19+
- licensed notices
20+
- mkdir -p debian/arduino-cli/usr/share/doc/arduino-cli/
21+
- cat LICENSE.txt > debian/arduino-cli/usr/share/doc/arduino-cli/copyright
22+
- echo -e "\n\n---\n\n" >> debian/arduino-cli/usr/share/doc/arduino-cli/copyright
23+
- find .licenses -type f -name "LICENSE*" -exec bash -c 'cat "$1"; echo -e "\n\n---\n\n"' _ {} \; >> debian/arduino-cli/usr/share/doc/arduino-cli/copyright
24+
sources:
25+
- LICENSE.txt
26+
- licenses/**
27+
28+
29+
30+
append-license:
31+
desc: Render and append arduino-cli license to NOTICE file
32+
cmds:
33+
- |
34+
rendered=$(envsubst < .licenses/templates/arduino-cli-license.txt)
35+
notice_file=".licenses/NOTICE.arduino-cli"
36+
tmp_file=$(mktemp)
37+
echo "$rendered" > "$tmp_file"
38+
echo -e "\n" >> "$tmp_file"
39+
cat "$notice_file" >> "$tmp_file"
40+
mv "$tmp_file" "$notice_file"
41+
env:
42+
Year: '{{ now | date "2006" }}'
43+
Holder: 'ARDUINO SA (http://www.arduino.cc/)'
44+
silent: false
45+
746
docs:generate:
847
desc: Create all generated documentation content
948
deps:

0 commit comments

Comments
 (0)