-
Notifications
You must be signed in to change notification settings - Fork 1
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
0 parents
commit 0213c67
Showing
6 changed files
with
245 additions
and
0 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,22 @@ | ||
--- | ||
name: Build Docker Image | ||
|
||
on: [push, pull_request] | ||
Check warning on line 4 in .github/workflows/build.yml GitHub Actions / YAML
|
||
|
||
jobs: | ||
build-docker: | ||
name: "Build Docker Image" | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Build Docker Image | ||
run: | | ||
docker build \ | ||
--build-arg CONTAINER \ | ||
--build-arg VERSION \ | ||
-t sdk \ | ||
. | ||
env: | ||
# Utilize matrix with release-versions once available | ||
VERSION: master | ||
shell: bash |
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,32 @@ | ||
--- | ||
name: "Lint" | ||
|
||
on: [push, pull_request] | ||
Check warning on line 4 in .github/workflows/lint.yml GitHub Actions / YAML
|
||
|
||
jobs: | ||
lint-yaml: | ||
name: "YAML" | ||
runs-on: ubuntu-22.04 | ||
env: | ||
YAML_FILES: | | ||
.github/workflows/build.yml | ||
.github/workflows/lint.yml | ||
action.yml | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Install Dependencies | ||
run: sudo apt-get update && sudo apt-get install -y yamllint shellcheck | ||
- name: Validate YAML Files | ||
run: yamllint $YAML_FILES | ||
|
||
shellcheck: | ||
name: "Shell Scripts" | ||
runs-on: ubuntu-22.04 | ||
env: | ||
SHELL_FILES: entrypoint.sh | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Install Dependencies | ||
run: sudo apt-get update && sudo apt-get install -y shellcheck | ||
- name: Validate Shell Scripts | ||
run: shellcheck $SHELL_FILES |
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,7 @@ | ||
ARG CONTAINER=ghcr.io/freifunk-gluon/gluon-build | ||
ARG VERSION=master | ||
FROM $CONTAINER:$VERSION | ||
|
||
COPY --chmod=0755 entrypoint.sh / | ||
|
||
ENTRYPOINT ["/entrypoint.sh"] |
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,86 @@ | ||
# action-gluon-build | ||
|
||
GitHub Actions action to interact with the Gluon build-framework. | ||
|
||
This Action utlizes the `gluon-build` docker container. | ||
|
||
|
||
## Input | ||
|
||
### container-version | ||
#### Description | ||
Container version to use | ||
|
||
#### Default | ||
master | ||
|
||
|
||
### gluon-path | ||
#### Description | ||
Path to Gluon repository | ||
|
||
#### Default | ||
true | ||
|
||
|
||
### site-path: | ||
#### Description | ||
Path to Gluon site-directory | ||
|
||
#### Default | ||
Working Directory | ||
|
||
|
||
### autoremove | ||
#### Description | ||
Remove build-directories after build | ||
|
||
#### Default | ||
1 | ||
|
||
### autoupdater-enabled | ||
#### Description | ||
Autoupdater should be enabled by default | ||
|
||
#### Default | ||
0 | ||
|
||
|
||
### autoupdater-branch | ||
#### Description | ||
Default branch for the Autoupdater | ||
|
||
|
||
### broken | ||
#### Description | ||
Determines if BROKEN devices should be built | ||
|
||
#### Default | ||
0 | ||
|
||
|
||
### deprecated | ||
#### Description | ||
Determines if deprecated devices should be built | ||
#### Default | ||
0 | ||
|
||
|
||
### hardware-target | ||
#### Description | ||
Target to build | ||
|
||
|
||
### make-target | ||
#### Description | ||
Make target to use | ||
|
||
|
||
### priority | ||
#### Description | ||
Priority indicator for the autoupdater | ||
|
||
|
||
### release | ||
#### Description | ||
Version string for the release to use |
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,76 @@ | ||
--- | ||
name: "Build Gluon" | ||
description: "Build Gluon images using the build-gluon docker container" | ||
inputs: | ||
container-version: | ||
description: 'Container version to use' | ||
default: 'master' | ||
gluon-path: | ||
description: 'Path to Gluon repository' | ||
required: true | ||
site-path: | ||
description: 'Path to Gluon site-directory' | ||
default: '' | ||
autoremove: | ||
description: 'Remove build-directories after build (Default: 1)' | ||
default: 1 | ||
autoupdater-enabled: | ||
description: 'Autoupdater should be enabled by default (Default: 0)' | ||
default: 0 | ||
autoupdater-branch: | ||
description: 'Default branch for the Autoupdater' | ||
broken: | ||
description: 'Determines if BROKEN devices should be built (Default: 0)' | ||
default: 0 | ||
deprecated: | ||
description: 'Determines if deprecated devices should be built (Default: 0)' | ||
default: 0 | ||
hardware-target: | ||
description: 'Target to build' | ||
make-target: | ||
description: 'Make target to use' | ||
default: '' | ||
priority: | ||
description: Priority indicator for the autoupdater | ||
release: | ||
description: 'Version string for the release to use' | ||
runs: | ||
using: 'composite' | ||
steps: | ||
- run: | | ||
docker build \ | ||
--build-arg CONTAINER \ | ||
--build-arg VERSION \ | ||
-t sdk \ | ||
$GITHUB_ACTION_PATH | ||
env: | ||
VERSION: ${{ inputs.container-version }} | ||
shell: bash | ||
- run: | | ||
docker run --rm \ | ||
--user "$(id -u):$(id -g)" \ | ||
--env ACTION_MAKE_TARGET \ | ||
--env ACTION_GLUON_AUTOREMOVE \ | ||
--env ACTION_GLUON_AUTOUPDATER_ENABLED \ | ||
--env ACTION_GLUON_AUTOUPDATER_BRANCH \ | ||
--env ACTION_GLUON_BROKEN \ | ||
--env ACTION_GLUON_DEPRECATED \ | ||
--env ACTION_GLUON_PRIORITY \ | ||
--env ACTION_GLUON_RELEASE \ | ||
--env ACTION_GLUON_TARGET \ | ||
--volume "$GITHUB_WORKSPACE/$ACTION_SITE_PATH:/gluon/site-repo" \ | ||
--volume "$GITHUB_WORKSPACE/$ACTION_GLUON_PATH:/gluon/gluon-repo" \ | ||
sdk | ||
env: | ||
ACTION_GLUON_AUTOREMOVE: ${{ inputs.autoremove }} | ||
ACTION_GLUON_AUTOUPDATER_ENABLED: ${{ inputs.autoupdater-enabled }} | ||
ACTION_GLUON_AUTOUPDATER_BRANCH: ${{ inputs.autoupdater-branch }} | ||
ACTION_GLUON_BROKEN: ${{ inputs.broken }} | ||
ACTION_GLUON_DEPRECATED: ${{ inputs.deprecated }} | ||
ACTION_GLUON_PRIORITY: ${{ inputs.priority }} | ||
ACTION_GLUON_RELEASE: ${{ inputs.release }} | ||
ACTION_GLUON_TARGET: ${{ inputs.hardware-target }} | ||
ACTION_MAKE_TARGET: ${{ inputs.make-target }} | ||
ACTION_GLUON_PATH: ${{ inputs.gluon-path }} | ||
ACTION_SITE_PATH: ${{ inputs.site-path }} | ||
shell: bash |
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,22 @@ | ||
#!/bin/bash | ||
|
||
set -euxo pipefail | ||
|
||
BUILD_THREADS="$(($(nproc) + 1))" | ||
|
||
# Determine Gluon Make args | ||
GLUON_MAKE_ARGS="" | ||
[ -n "${ACTION_GLUON_AUTOREMOVE+x}" ] && GLUON_MAKE_ARGS="${GLUON_MAKE_ARGS} GLUON_AUTOREMOVE=${ACTION_GLUON_AUTOREMOVE}" | ||
[ -n "${ACTION_GLUON_TARGET+x}" ] && GLUON_MAKE_ARGS="${GLUON_MAKE_ARGS} GLUON_TARGET=${ACTION_GLUON_TARGET}" | ||
[ -n "${ACTION_GLUON_BROKEN+x}" ] && GLUON_MAKE_ARGS="${GLUON_MAKE_ARGS} BROKEN=${ACTION_GLUON_BROKEN}" | ||
[ -n "${ACTION_GLUON_AUTOUPDATER_BRANCH+x}" ] && GLUON_MAKE_ARGS="${GLUON_MAKE_ARGS} GLUON_AUTOUPDATER_BRANCH=${ACTION_GLUON_AUTOUPDATER_BRANCH}" | ||
[ -n "${ACTION_GLUON_AUTOUPDATER_ENABLED+x}" ] && GLUON_MAKE_ARGS="${GLUON_MAKE_ARGS} GLUON_AUTOUPDATER_ENABLED=${ACTION_GLUON_AUTOUPDATER_ENABLED}" | ||
[ -n "${ACTION_GLUON_RELEASE+x}" ] && GLUON_MAKE_ARGS="${GLUON_MAKE_ARGS} GLUON_RELEASE=${ACTION_GLUON_RELEASE}" | ||
[ -n "${ACTION_GLUON_PRIORITY+x}" ] && GLUON_MAKE_ARGS="${GLUON_MAKE_ARGS} GLUON_PRIORITY=${ACTION_GLUON_PRIORITY}" | ||
|
||
echo "Building with ${BUILD_THREADS} threads" | ||
echo "Extra args for build: '${GLUON_MAKE_ARGS}'" | ||
|
||
# shellcheck disable=SC2086 | ||
# Build | ||
make -C /gluon/gluon-repo $ACTION_MAKE_TARGET $GLUON_MAKE_ARGS GLUON_SITEDIR=/gluon/site-repo V=s "-j$BUILD_THREADS" |