Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
Initial commit of MACHINE.

Signed-off-by: Michael Mitchell <[email protected]>
  • Loading branch information
mmitchel committed Dec 26, 2024
0 parents commit 919c84c
Show file tree
Hide file tree
Showing 7 changed files with 672 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# default ownership: default owners for everything in the repo (Unless a later match takes precedence)
* @distro-core/developers
107 changes: 107 additions & 0 deletions .github/workflows/images-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
name: Dispatch Images Build

# This workflow represents a specific configuration for a
# single MACHINE as a specific design goal. It utilizes a
# reusable workflow found at distro-core/distro-manifest.

# Variables and Actions
# secrets.AWS_ACCESS_KEY_ID Reusable Workflow, S3 Access Key
# secrets.AWS_SECRET_ACCESS_KEY Reusable Workflow, S3 Secret Key
# secrets.AWS_ENDPOINT_URL Reusable Workflow, S3 Endpoint Hostname
# liskin/gh-workflow-keepalive Action, Keepalive

# Self hosted runners have the prerequsite dependency to
# install the host tools dependencies before workflow use.

on:
workflow_dispatch:
inputs:
DISTROS:
required: true
type: choice
default: distro-core
options:
- distro-core
- distro-core-gui
TARGETS:
required: true
type: string
default: distro-image

permissions:
actions: write
contents: write

defaults:
run:
shell: bash

jobs:

# runner-name selects a self-hosted runner which has a label that
# matches its name. The setup has to be performed before the
# workflow instance is used.

runner-name:
runs-on: self-hosted
outputs:
runner-name: ${{ runner.name }}
steps:
- run: echo "selected runner ${{ runner.name }}"

# keepalive prevents the workflow from being disabled due to
# repository inactivity.

keepalive:
needs: [ runner-name ]
runs-on: ${{ needs.runner-name.outputs.runner-name }}
steps:
- uses: liskin/[email protected]

# remove the workspace contents before starting; self-hosted runners
# retain the workspace contents between jobs.

pre-cleanup:
needs: [ runner-name, keepalive ]
runs-on: ${{ needs.runner-name.outputs.runner-name }}
if: always()
steps:
- run: |
: cleanup
# rm -fr -- $GITHUB_WORKSPACE/{*,.*} || true
ls -al $GITHUB_WORKSPACE
# the reusable workflow is called with parameters for the specifics
# of the process.

build:
needs: [ runner-name, pre-cleanup ]
uses: distro-core/distro-manifest/.github/workflows/images-build.yml@main
with:
runner-name: ${{ needs.runner-name.outputs.runner-name }}
timeout-minutes: 720
DISTRO_CODENAME: kirkstone
DISTROS: ${{ inputs.DISTROS }}
MACHINES: ssbc-pine64-star64
TARGETS: ${{ inputs.TARGETS }}
TARGET_FLAGS:
MANIFEST_URI: https://github.com/distro-core/distro-manifest.git
MANIFEST_BRANCH: main
MANIFEST_NAME: distro-head-kirkstone.xml
secrets:
AWS_ENDPOINT_URL: ${{ secrets.AWS_ENDPOINT_URL }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}

# remove the workspace contents upon completion; self-hosted runners
# retain the workspace contents between jobs.

post-cleanup:
runs-on: ${{ needs.runner-name.outputs.runner-name }}
needs: [ runner-name, build ]
if: always()
steps:
- run: |
: cleanup
# rm -fr -- $GITHUB_WORKSPACE/{*,.*} || true
ls -al $GITHUB_WORKSPACE
107 changes: 107 additions & 0 deletions .github/workflows/images-fetch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
name: Dispatch Images Fetch

# This workflow represents a specific configuration for a
# single MACHINE as a specific design goal. It utilizes a
# reusable workflow found at distro-core/distro-manifest.

# Variables and Actions
# secrets.AWS_ACCESS_KEY_ID Reusable Workflow, S3 Access Key
# secrets.AWS_SECRET_ACCESS_KEY Reusable Workflow, S3 Secret Key
# secrets.AWS_ENDPOINT_URL Reusable Workflow, S3 Endpoint Hostname
# liskin/gh-workflow-keepalive Action, Keepalive

# Self hosted runners have the prerequsite dependency to
# install the host tools dependencies before workflow use.

on:
workflow_dispatch:
inputs:
DISTROS:
required: true
type: choice
default: distro-core
options:
- distro-core
- distro-core-gui
TARGETS:
required: true
type: string
default: distro-image

permissions:
actions: write
contents: write

defaults:
run:
shell: bash

jobs:

# runner-name selects a self-hosted runner which has a label that
# matches its name. The setup has to be performed before the
# workflow instance is used.

runner-name:
runs-on: self-hosted
outputs:
runner-name: ${{ runner.name }}
steps:
- run: echo "selected runner ${{ runner.name }}"

# keepalive prevents the workflow from being disabled due to
# repository inactivity.

keepalive:
needs: [ runner-name ]
runs-on: ${{ needs.runner-name.outputs.runner-name }}
steps:
- uses: liskin/[email protected]

# remove the workspace contents before starting; self-hosted runners
# retain the workspace contents between jobs.

pre-cleanup:
needs: [ runner-name, keepalive ]
runs-on: ${{ needs.runner-name.outputs.runner-name }}
if: always()
steps:
- run: |
: cleanup
# rm -fr -- $GITHUB_WORKSPACE/{*,.*} || true
ls -al $GITHUB_WORKSPACE
# the reusable workflow is called with parameters for the specifics
# of the process.

fetch:
needs: [ runner-name, keepalive ]
uses: distro-core/distro-manifest/.github/workflows/images-build.yml@main
with:
runner-name: ${{ needs.runner-name.outputs.runner-name }}
timeout-minutes: 360
DISTRO_CODENAME: kirkstone
DISTROS: ${{ inputs.DISTROS }}
MACHINES: sbc-pine64-star64
TARGETS: ${{ inputs.TARGETS }}
TARGET_FLAGS: --runall=fetch
MANIFEST_URI: https://github.com/distro-core/distro-manifest.git
MANIFEST_BRANCH: main
MANIFEST_NAME: distro-head-kirkstone.xml
secrets:
AWS_ENDPOINT_URL: ${{ secrets.AWS_ENDPOINT_URL }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}

# remove the workspace contents upon completion; self-hosted runners
# retain the workspace contents between jobs.

post-cleanup:
runs-on: ${{ needs.runner-name.outputs.runner-name }}
needs: [ runner-name, fetch ]
if: always()
steps:
- run: |
: cleanup
# rm -fr -- $GITHUB_WORKSPACE/{*,.*} || true
ls -al $GITHUB_WORKSPACE
97 changes: 97 additions & 0 deletions .github/workflows/scheduled-images-fetch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
name: Scheduled Images Fetch

# This workflow represents a specific configuration for a
# single MACHINE as a specific design goal. It utilizes a
# reusable workflow found at distro-core/distro-manifest.

# Variables and Actions
# secrets.AWS_ACCESS_KEY_ID Reusable Workflow, S3 Access Key
# secrets.AWS_SECRET_ACCESS_KEY Reusable Workflow, S3 Secret Key
# secrets.AWS_ENDPOINT_URL Reusable Workflow, S3 Endpoint Hostname
# liskin/gh-workflow-keepalive Action, Keepalive

# Self hosted runners have the prerequsite dependency to
# install the host tools dependencies before workflow use.

on:
# schedule:
# - cron: '30 6 * * MON'
workflow_dispatch:

permissions:
actions: write
contents: write

defaults:
run:
shell: bash

jobs:

# runner-name selects a self-hosted runner which has a label that
# matches its name. The setup has to be performed before the
# workflow instance is used.

runner-name:
runs-on: self-hosted
outputs:
runner-name: ${{ runner.name }}
steps:
- run: echo "selected runner ${{ runner.name }}"

# keepalive prevents the workflow from being disabled due to
# repository inactivity.

keepalive:
needs: [ runner-name ]
runs-on: ${{ needs.runner-name.outputs.runner-name }}
steps:
- uses: liskin/[email protected]

# remove the workspace contents before starting; self-hosted runners
# retain the workspace contents between jobs.

pre-cleanup:
needs: [ runner-name, keepalive ]
runs-on: ${{ needs.runner-name.outputs.runner-name }}
if: always()
steps:
- run: |
: cleanup
# rm -fr -- $GITHUB_WORKSPACE/{*,.*} || true
ls -al $GITHUB_WORKSPACE
# the reusable workflow is called with parameters for the specifics
# of the process.

fetch:
needs: [ runner-name, keepalive ]
uses: distro-core/distro-manifest/.github/workflows/images-build.yml@main
with:
runner-name: ${{ needs.runner-name.outputs.runner-name }}
timeout-minutes: 360
DISTRO_CODENAME: kirkstone
DISTROS: distro-core
MACHINES: sbc-pine64-star64
TARGETS: distro-image
TARGET_FLAGS: --runall=fetch
MANIFEST_URI: https://github.com/distro-core/distro-manifest.git
MANIFEST_BRANCH: main
MANIFEST_NAME: distro-head-kirkstone.xml
secrets:
AWS_ENDPOINT_URL: ${{ secrets.AWS_ENDPOINT_URL }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}

# remove the workspace contents upon completion; self-hosted runners
# retain the workspace contents between jobs.

post-cleanup:
runs-on: ${{ needs.runner-name.outputs.runner-name }}
needs: [ runner-name, fetch ]
if: always()
steps:
- run: |
: cleanup
# rm -fr -- $GITHUB_WORKSPACE/{*,.*} || true
ls -al $GITHUB_WORKSPACE
Loading

0 comments on commit 919c84c

Please sign in to comment.