12
12
debian-package :
13
13
name : " Build debian packages"
14
14
runs-on : ubuntu-latest
15
+ environment :
16
+ name : " release"
15
17
container :
16
18
image : " ubuntu:bionic"
17
19
steps :
54
56
image : " ubuntu:focal"
55
57
options : --privileged
56
58
needs : debian-package
59
+ permissions :
60
+ contents : write
57
61
steps :
58
62
- name : Install dependencies
59
63
run : |
@@ -68,54 +72,52 @@ jobs:
68
72
cd images/vm/
69
73
./build-faucet-vm.sh
70
74
- name : Upload release asset
71
- id : upload-release-asset
72
- uses : actions/upload-release-asset@v1
73
- env :
74
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
75
+ uses : svenstaro/upload-release-action@v2
75
76
with :
76
- upload_url : ${{ github.event.release.upload_url }}
77
- asset_path : ./images/vm/faucet-amd64-${{ github.event.release.tag_name }}.qcow2
77
+ repo_token : ${{ secrets.GITHUB_TOKEN }}
78
+ tag : ${{ github.ref }}
79
+ overwrite : true
80
+ file : ./images/vm/faucet-amd64-${{ github.event.release.tag_name }}.qcow2
78
81
asset_name : faucet-amd64-${{ github.event.release.tag_name }}.qcow2
79
- asset_content_type : application/octet-stream
80
82
81
83
rpi-image :
82
84
name : " Build raspberry pi image"
83
85
runs-on : ubuntu-latest
84
- container :
85
- image : " ubuntu:bionic"
86
- options : --privileged
87
86
needs : debian-package
87
+ permissions :
88
+ contents : write
88
89
steps :
89
90
- name : Install dependencies
90
91
run : |
91
- dpkg --add-architecture i386
92
- apt-get update
93
- apt-get -y upgrade
94
- apt-get install -y coreutils quilt parted qemu-user-static:i386 debootstrap zerofree zip dosfstools libarchive-tools libcap2-bin grep rsync xz-utils file git curl bc xxd kmod binfmt-support
95
- /usr/sbin/update-binfmts --enable
92
+ sudo apt-get update
93
+ sudo apt-get -y upgrade
94
+ sudo apt-get install -y binfmt-support
95
+ - name : Prepare build environment
96
+ run : |
97
+ sudo /usr/sbin/update-binfmts --enable
98
+ sudo modprobe nbd
96
99
- name : Checkout repo
97
100
uses : actions/checkout@v2
98
101
- name : Install pi-gen
99
102
run : |
100
103
cd images/raspbian/
101
104
git clone https://github.com/RPi-Distro/pi-gen.git
102
- cd pi-gen
103
- mv ../install-faucet.sh ./stage2/01-sys-tweaks/02-install-faucet.sh
104
105
- name : Build image
105
106
run : |
106
107
cd images/raspbian/pi-gen/
107
108
echo "IMG_NAME='faucet_${{ github.event.release.tag_name }}_raspbian'" > config
109
+ mkdir ./stage2/04-install-faucet/
110
+ mv ../install-faucet.sh ./stage2/04-install-faucet/02-run.sh
111
+ rm ./stage2/EXPORT_NOOBS
108
112
touch ./stage3/SKIP ./stage4/SKIP ./stage5/SKIP
109
113
touch ./stage4/SKIP_IMAGES ./stage5/SKIP_IMAGES
110
- ./build.sh
114
+ ./build-docker .sh
111
115
mv ./deploy/image_*_raspbian-lite.zip ./deploy/faucet_${{ github.event.release.tag_name }}_raspbian-lite.zip
112
116
- name : Upload release asset
113
- id : upload-release-asset
114
- uses : actions/upload-release-asset@v1
115
- env :
116
- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
117
+ uses : svenstaro/upload-release-action@v2
117
118
with :
118
- upload_url : ${{ github.event.release.upload_url }}
119
- asset_path : ./images/raspbian/pi-gen/deploy/faucet_${{ github.event.release.tag_name }}_raspbian-lite.zip
119
+ repo_token : ${{ secrets.GITHUB_TOKEN }}
120
+ tag : ${{ github.ref }}
121
+ overwrite : true
122
+ file : ./images/raspbian/pi-gen/deploy/faucet_${{ github.event.release.tag_name }}_raspbian-lite.zip
120
123
asset_name : faucet_${{ github.event.release.tag_name }}_raspbian-lite.zip
121
- asset_content_type : application/zip
0 commit comments