@@ -1,50 +0,0 @@ | |||||
on: | |||||
release: | |||||
types: [ created ] | |||||
name: Build & Deploy Image | |||||
jobs: | |||||
build: | |||||
name: Build & Release Image | |||||
runs-on: self-hosted | |||||
timeout-minutes: 2880 | |||||
env: | |||||
working-directory: ./ | |||||
steps: | |||||
- name: Checkout code | |||||
uses: actions/checkout@v2 | |||||
- name: Clean docker | |||||
id: clean_docker | |||||
working-directory: ${{ env.working-directory }} | |||||
run: | | |||||
docker system prune -af | |||||
docker system prune --volumes -f | |||||
docker image prune -af | |||||
docker container stop $(docker container ls -aq) || true | |||||
docker container rm $(docker container ls -aq) || true | |||||
- name: Build project | |||||
id: builder | |||||
working-directory: ${{ env.working-directory }} | |||||
run: | | |||||
bash build-docker.sh | |||||
echo ::set-output name=filename::$(ls deploy/*.img.xz | xargs -n 1 basename) | |||||
- name: Fix Permissions | |||||
id: fix_perm_filename | |||||
run: | | |||||
chmod a+rw ${{ env.working-directory }}/deploy/${{ steps.builder.outputs.filename }} | |||||
echo ${{ env.working-directory }}/deploy/${{ steps.builder.outputs.filename }} | |||||
- name: Upload Release Asset | |||||
id: upload-release-asset | |||||
uses: actions/upload-release-asset@v1 | |||||
env: | |||||
GITHUB_TOKEN: ${{ secrets.LONG_TOKEN }} | |||||
with: | |||||
upload_url: ${{ github.event.release.upload_url }} | |||||
asset_path: ${{ env.working-directory }}/deploy/${{ steps.builder.outputs.filename }} | |||||
asset_name: ${{ steps.builder.outputs.filename }} | |||||
asset_content_type: application/x-tar | |||||
- name: Delete Image | |||||
id: delete_image | |||||
run: | | |||||
rm ${{ env.working-directory }}/deploy/${{ steps.builder.outputs.filename }} |
@@ -1,11 +1,11 @@ | |||||
on: ['pull_request'] | |||||
on: ['commit'] | |||||
name: Build & Validate Image | name: Build & Validate Image | ||||
jobs: | jobs: | ||||
build: | build: | ||||
name: Build & Validate Image | name: Build & Validate Image | ||||
runs-on: self-hosted | |||||
runs-on: arm64 | |||||
timeout-minutes: 2880 | timeout-minutes: 2880 | ||||
env: | env: | ||||
working-directory: ./ | working-directory: ./ | ||||
@@ -5,7 +5,6 @@ | |||||
vars: | vars: | ||||
PISDR_USER: luigi | PISDR_USER: luigi | ||||
pre_tasks: | pre_tasks: | ||||
- {include: 'tasks/mount.yaml', tags: 'always'} | |||||
- {include: 'tasks/update-apt.yaml', tags: 'always'} | - {include: 'tasks/update-apt.yaml', tags: 'always'} | ||||
roles: | roles: | ||||
- {role: 'uhd', tags: 'uhd'} | - {role: 'uhd', tags: 'uhd'} | ||||
@@ -2,6 +2,7 @@ | |||||
- name: Umount pseudo filesystems | - name: Umount pseudo filesystems | ||||
connection: local | connection: local | ||||
shell: umount -l '{{ lookup('env', 'ANSIBLE_ROOTFS_DIR') }}{{ item }}' | shell: umount -l '{{ lookup('env', 'ANSIBLE_ROOTFS_DIR') }}{{ item }}' | ||||
ignore_errors: yes | |||||
with_items: | with_items: | ||||
- /proc | - /proc | ||||
- /dev/pts | - /dev/pts | ||||
@@ -12,9 +12,9 @@ export PISDR_IMG_NAME="$(date '+%Y-%m-%d')-PiSDR-$PISDR_ARCH" | |||||
#### Build Settings | #### Build Settings | ||||
BUILD_BOARD_TEGRA_NANO=true | BUILD_BOARD_TEGRA_NANO=true | ||||
BUILD_BOARD_TEGRA_AGX=true | |||||
BUILD_BOARD_TEGRA_AGX=false | |||||
BUILD_BOARD_RPI=false | BUILD_BOARD_RPI=false | ||||
BUILD_BOARD_GRUB=true | |||||
BUILD_BOARD_GRUB=false | |||||
#### Compiler Settings | #### Compiler Settings | ||||
export TARGET="/target" | export TARGET="/target" | ||||
@@ -6,13 +6,15 @@ printf "Create base rootfs directory... " | |||||
mkdir -p $BASE_DIR | mkdir -p $BASE_DIR | ||||
printf "(OK)\n" | printf "(OK)\n" | ||||
printf "Enabling qemu kernel components... " | |||||
update-binfmts --enable qemu-arm > /dev/null 2>&1 | |||||
if [ ! "$(ls -A /proc/sys/fs/binfmt_misc/)" ]; then | |||||
printf "(NOK)\n" | |||||
exit | |||||
if [[ "$PISDR_ARCH" != $(uname -p) ]]; then | |||||
printf "Enabling qemu kernel components... " | |||||
update-binfmts --enable qemu-arm > /dev/null 2>&1 | |||||
if [ ! "$(ls -A /proc/sys/fs/binfmt_misc/)" ]; then | |||||
printf "(NOK)\n" | |||||
exit | |||||
fi | |||||
printf "(OK)\n" | |||||
fi | fi | ||||
printf "(OK)\n" | |||||
echo "Run debootstrap first stage..." | echo "Run debootstrap first stage..." | ||||
if [ ! -f "${BASE_DIR}/.bootstrap_completed" ]; then | if [ ! -f "${BASE_DIR}/.bootstrap_completed" ]; then | ||||