-
Notifications
You must be signed in to change notification settings - Fork 2
66 lines (65 loc) · 2.39 KB
/
release.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
name: HoneyPi CI release
on:
push:
branches:
- master
workflow_dispatch:
# To cancel a currently running workflow from the same PR, branch or tag when a new workflow is triggered
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
rpi-image:
name: "Build 🍯-🐝-Image"
runs-on: ubuntu-latest
steps:
- name: Get current date
id: date
run: |
echo "{date}={$(date +'%Y-%m-%d')}" >> $GITHUB_STATE
- name: Checkout
uses: actions/checkout@v4
# install dependencies
- name: 🔽 Install dependencies
run: |
sudo apt-get update
sudo apt-get -y install --no-install-recommends coreutils quilt parted qemu-utils qemu-user-static debootstrap zerofree zip dosfstools libarchive-tools libcap2-bin grep rsync xz-utils file git curl bc
# build image
- name: 🚧 Build
run: |
git clone https://github.com/RPi-Distro/pi-gen pi-gen
cd pi-gen && git fetch && git fetch --tags
git checkout 2023-02-21-raspios-bullseye
cp ./../config ./config
cp -R ./../stage-honeypi ./stage-honeypi
sudo ./build.sh
sudo mv ./deploy/*.zip ./deploy/HoneyPi.zip
sudo chown -fR $(stat -c "%U:%G" .) ./deploy
# delete previous releases
- name: 🗑️ Delete previous releases
uses: dev-drprasad/delete-older-releases@0.3.2
with:
keep_latest: 0
delete_tags: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# create release and upload image
- name: 🚀 Create release and upload image
uses: svenstaro/upload-release-action@2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: pi-gen/deploy/HoneyPi.zip
asset_name: $ASSET_NAME
tag: $TAG_NAME
release_name: $RELEASE_NAME
body: "Raspberry Pi OS Lite image with HoneyPi pre installed. Release created by GitHub action."
overwrite: true
env:
TAG_NAME: ${{ env.date }}-HoneyPi
RELEASE_NAME: ${{ env.date }}-HoneyPi-Image
ASSET_NAME: ${{ env.date }}-HoneyPi-Image.zip
- name: Add artifact to Workflow
uses: actions/upload-artifact@v4
with:
name: HoneyPi-Image
path: pi-gen/deploy/HoneyPi.zip