-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
129 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
on: [push] | ||
|
||
env: | ||
RELEASE_START: 100 | ||
|
||
jobs: | ||
build: | ||
runs-on: [self-hosted, Linux, ARM64] | ||
container: ayufan/rock64-dockerfiles:bookworm | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Configure ccache | ||
run: echo "CCACHE_DIR=$RUNNER_TEMP/ccache" >> $GITHUB_ENV | ||
- name: Configure version | ||
run: echo "VERSION=$(cat VERSION).$(($RELEASE_START+$GITHUB_RUN_NUMBER))" >> $GITHUB_ENV | ||
- name: Reset ccache statistics | ||
run: ccache -M 0 -F 0 | ||
- name: Cleanup old packages | ||
run: rm -f *.tar.xz | ||
- name: Install keyring | ||
run: make keyring | ||
- name: Build images | ||
run: make all | ||
- name: Release images | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
set -x | ||
export RELEASE_NAME="$VERSION" | ||
export RELEASE_TITLE="$VERSION" | ||
export DESCRIPTION="$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" | ||
github-release release \ | ||
--tag "${RELEASE_NAME}" \ | ||
--name "${RELEASE_TITLE}" \ | ||
--user "${GITHUB_REPOSITORY%/*}" \ | ||
--repo "${GITHUB_REPOSITORY#*/}" \ | ||
--description "${DESCRIPTION}" \ | ||
--target "${GITHUB_SHA}" \ | ||
--draft | ||
sleep 3s # allow to update release | ||
for i in *.tar.xz; do | ||
github-release upload \ | ||
--tag "${RELEASE_NAME}" \ | ||
--name "$(basename "${i}")" \ | ||
--user "${GITHUB_REPOSITORY%/*}" \ | ||
--repo "${GITHUB_REPOSITORY#*/}" \ | ||
--file "${i}" | ||
done | ||
github-release edit \ | ||
--tag "${RELEASE_NAME}" \ | ||
--name "${RELEASE_TITLE}" \ | ||
--user "${GITHUB_REPOSITORY%/*}" \ | ||
--repo "${GITHUB_REPOSITORY#*/}" \ | ||
--description "${DESCRIPTION}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ | |
/tmp/ | ||
/*.tar | ||
/*.tar.xz | ||
/*.deb |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,32 @@ | ||
export VERSION ?= 0.1~dev | ||
|
||
VARIANTS := $(patsubst configs/%,%,$(wildcard configs/*-*-*)) | ||
VARIANTS := $(patsubst configs/%,%,$(wildcard configs/debian-*-*)) | ||
|
||
all: \ | ||
$(patsubst %,%-$(VERSION)-armhf.tar.xz,$(VARIANTS)) \ | ||
$(patsubst %,%-$(VERSION)-arm64.tar.xz,$(VARIANTS)) | ||
ARCHS := arm64 | ||
TARGETS := $(foreach arch,$(ARCHS),$(patsubst %,%-$(VERSION)-$(arch).tar.xz,$(VARIANTS))) | ||
|
||
all: $(TARGETS) | ||
|
||
keyring: | ||
bash -c 'dpkg -s ubuntu-keyring &>/dev/null || \ | ||
( wget -c http://mirrors.kernel.org/ubuntu/pool/main/u/ubuntu-keyring/ubuntu-keyring_2021.03.26_all.deb && \ | ||
dpkg -i ubuntu-keyring_2021.03.26_all.deb && \ | ||
rm ubuntu-keyring_2021.03.26_all.deb )' | ||
|
||
info: | ||
@echo $(VARIANTS) | ||
|
||
targets: | ||
@echo $(TARGETS) | ||
|
||
%.xz: % | ||
xz -T 0 -f -3 $< | ||
|
||
%.tar: | ||
eatmydata -- bash build.sh "$@" \ | ||
"$(shell basename "$@" -$(VERSION)-$(BUILD_ARCH).tar)" \ | ||
"$(BUILD_MODE)" \ | ||
"$(BUILD_SUITE)" \ | ||
"$(BUILD_ARCH)" | ||
|
||
%-armhf.tar.xz: BUILD_ARCH=armhf | ||
%-arm64.tar.xz: BUILD_ARCH=arm64 | ||
|
||
$(addsuffix -arm64, $(VARIANTS)): %-arm64: %-$(VERSION)-arm64.tar.xz | ||
|
||
debian-%.tar.xz: BUILD_MODE=debian | ||
debian-bookworm-%.tar.xz: BUILD_SUITE=bookworm | ||
|
||
.PHONY: shell # run docker shell to build image | ||
shell: | ||
@echo Entering shell... | ||
@docker run --rm \ | ||
-it \ | ||
-e HOME -v $(HOME):$(HOME) \ | ||
--privileged \ | ||
-h rock64-build-env \ | ||
-v $(CURDIR):$(CURDIR) \ | ||
-w $(CURDIR) \ | ||
ayufan/rock64-dockerfiles:bookworm | ||
"$(word 1,$(subst -, , $@))-$(word 2,$(subst -, , $@))-$(word 3,$(subst -, , $@))" \ | ||
"$(word 1,$(subst -, , $@))" \ | ||
"$(word 2,$(subst -, , $@))" \ | ||
"$(word 5,$(subst -, , $(basename $@)))" | ||
|
||
$(foreach arch,$(ARCHS),$(addsuffix -$(arch), $(VARIANTS)): %-$(arch): %-$(VERSION)-$(arch).tar.xz) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
0.8 |
Empty file.
Empty file.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
dosfstools | ||
curl | ||
xz-utils | ||
iw | ||
rfkill | ||
wpasupplicant | ||
openssh-server | ||
alsa-utils | ||
nano | ||
git | ||
build-essential | ||
vim | ||
jq | ||
ethtool | ||
zram-config | ||
wget | ||
ca-certificates | ||
software-properties-common | ||
sudo | ||
htop | ||
ifupdown | ||
bash | ||
eatmydata |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
ubuntu-minimal | ||
gnupg2 | ||
gpg-agent |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/bash | ||
|
||
CURDIR="$PWD" | ||
|
||
exec docker run \ | ||
--rm \ | ||
-it \ | ||
-e HOME -v "${HOME}:${HOME}" \ | ||
-e USER \ | ||
-u "$(id -u):$(id -g)" \ | ||
$(id -Gz | xargs -0 -n1 -I{} echo "--group-add={}") \ | ||
-v /etc/passwd:/etc/passwd:ro \ | ||
-v /dev:/dev \ | ||
-v "${SSH_AUTH_SOCK}:${SSH_AUTH_SOCK}" \ | ||
-e SSH_AUTH_SOCK \ | ||
--privileged \ | ||
-h rock64-build-env \ | ||
-v "${CURDIR}:${CURDIR}" \ | ||
-w "${CURDIR}" \ | ||
ayufan/rock64-dockerfiles:bookworm \ | ||
"$@" |