Skip to content

Commit

Permalink
Create workflow: docker-build-alpine-image.yml
Browse files Browse the repository at this point in the history
Signed-off-by: Marcel <[email protected]>
  • Loading branch information
Styne13 committed Feb 24, 2022
1 parent bd01d3e commit 4a5851d
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 5 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/docker-build-alpine-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Docker Orange Pi Zero Alpine Image CI

on:
workflow_dispatch:

jobs:

build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Build the Docker Image
run: docker build -t orange-pi-zero-alpine-build:20.04 ./docker
- name: Build Orangepizero Alpine Image
run: docker run -e CORES=32 -v $PWD:/root/orange-pi-zero-alpine/ orange-pi-zero-alpine-build:20.04
- name: Export Version
run: echo "::set-output name=version::$(cat ALPINE_VERSION)"
id: version
- name: Upload Build Artifact Files
uses: actions/[email protected]
with:
name: orangepi-zero-alpine-image-${{ steps.version.outputs.version }}
path: orangepi-zero-alpine-image-${{ steps.version.outputs.version }}/
- name: Create Release
uses: actions/create-release@v1
id: create_release
with:
draft: false
prerelease: false
release_name: ${{ steps.version.outputs.version }}
tag_name: v${{ steps.version.outputs.version }}
body_path: CHANGELOG.md
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Upload Kernel Artifacts
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: orangepi-zero-alpine-image-${{ steps.version.outputs.version }}.tar.gz
asset_name: orangepi-zero-alpine-image-${{ steps.version.outputs.version }}.tar.gz
asset_content_type: application/gzip
21 changes: 16 additions & 5 deletions docker/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,26 +21,37 @@ if [ -v $ALPINE_VERSION ]; then
ALPINE_VERSION=$(python3 -m lastversion --format tag alpine)
fi

#clone and switch to project directory
if [ ! -d "orange-pi-zero-alpine" ]; then
git clone https://github.com/moonbuggy/orange-pi-zero-alpine.git
fi
cd orange-pi-zero-alpine

#display Tags
echo "linux-stable LTS tag: ${LINUX_TAG}"
echo "u-boot tag: ${UBOOT_TAG}"
echo "alpine version: ${ALPINE_VERSION}"

#create changelog file
echo "linux-stable LTS tag: ${LINUX_TAG}" >> CHANGELOG.md
echo "u-boot tag: ${UBOOT_TAG}" >> CHANGELOG.md
echo "alpine version: ${ALPINE_VERSION}" >> CHANGELOG.md

#save tags for later use (e.g. automated export of build artifacts, tag/release)
echo "${LINUX_TAG}" > LINUX_TAG
echo "${UBOOT_TAG}" > UBOOT_TAG
echo "${ALPINE_VERSION}" > ALPINE_VERSION

if [ ! -d "orange-pi-zero-alpine" ]; then
git clone https://github.com/moonbuggy/orange-pi-zero-alpine.git
fi
cd orange-pi-zero-alpine

./configure

make -j ${CORES} uboot-defconfig
make -j ${CORES} linux-default
make -j ${CORES} xradio
make -j ${CORES} install

#rename image folder
mv files/ "orangepi-zero-alpine-image-${ALPINE_VERSION}"

#create tar image archive
tar czvf "orangepi-zero-alpine-image-${ALPINE_VERSION}.tar.gz" "orangepi-zero-alpine-image-${ALPINE_VERSION}"
exit 0

0 comments on commit 4a5851d

Please sign in to comment.