Skip to content

update workflows

update workflows #448

Workflow file for this run

name: build-main
on:
repository_dispatch:
types: [release-beta, release-prerelease, release-draft, release-dev]
workflow_dispatch:
push:
paths-ignore:
- '.github/**'
- 'LICENSE.md'
- 'Dockerfile'
- '.dockerignore'
branches:
- main
- dev
# Ensure that if there are multiple builds for main only 1 is queued during a build
# Example: 1st commit in main starts a build then 2-9 commits come in during the first build.
# 'concurrency' makes it so that only commit 9 is enqueued to build rather builds 2-9 all runing a build.
concurrency:
group: main
env:
# This is used by 'make docker-*' commands to determine image to build with
DOCKER_IMAGE: ghcr.io/${{ github.event.repository.owner.login }}/${{ github.event.repository.name }}-build:latest
jobs:
build-init:
timeout-minutes: 60
runs-on: main
steps:
#- uses: hmarr/debug-action@v2
# name: debug
- name: Get current branch as it may not be 'default branch'
id: branch
run: |
branch_arg="${{ github.event.client_payload.branch }}"
if [[ -z "$branch_arg" ]]; then
branch_arg="$GITHUB_REF_NAME"
fi
echo "branch=$branch_arg" >> $GITHUB_OUTPUT
- uses: actions/checkout@v4
name: Checkout
with:
clean: false
ref: "${{ steps.branch.outputs.branch }}"
build-rg351p:
needs: [build-init]
timeout-minutes: 360
runs-on: main
steps:
- name: Get date for artifacts
id: date
run: echo "date=$(date +'%Y%m%d_%H%M')" >> $GITHUB_OUTPUT
- name: Get short SHA for artifacts
id: sha
run: echo "sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Get dev (or draft release) version
id: version
run: |
set -e
echo "full name: ${{ github.event.repository.full_name }}"
if [[ "${{ github.event.client_payload.release_tag }}" != "" ]]; then
echo "version=${{ github.event.client_payload.release_tag }}" >> $GITHUB_OUTPUT
else
echo "version=dev-${{ steps.date.outputs.date }}-${{ steps.sha.outputs.sha }}" >> $GITHUB_OUTPUT
fi
- name: Build RG351P
run: |
set -e
export CUSTOM_VERSION="${{ steps.version.outputs.version }}"
make DOCKER_WORK_DIR=/work docker-RG351P
build-rg351v:
needs: [build-init, build-rg351p]
timeout-minutes: 360
runs-on: main
steps:
- name: Get date for artifacts
id: date
run: echo "date=$(date +'%Y%m%d_%H%M')" >> $GITHUB_OUTPUT
- name: Get short SHA for artifacts
id: sha
run: echo "sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Get dev (or draft release) version
id: version
run: |
set -e
echo "full name: ${{ github.event.repository.full_name }}"
if [[ "${{ github.event.client_payload.release_tag }}" != "" ]]; then
echo "version=${{ github.event.client_payload.release_tag }}" >> $GITHUB_OUTPUT
else
echo "version=dev-${{ steps.date.outputs.date }}-${{ steps.sha.outputs.sha }}" >> $GITHUB_OUTPUT
fi
- name: Build RG351V
run: |
set -e
export CUSTOM_VERSION="${{ steps.version.outputs.version }}"
make DOCKER_WORK_DIR=/work docker-RG351V
build-rg351mp:
needs: [build-init, build-rg351p, build-rg351v]
timeout-minutes: 360
runs-on: main
steps:
- name: Get date for artifacts
id: date
run: echo "date=$(date +'%Y%m%d_%H%M')" >> $GITHUB_OUTPUT
- name: Get short SHA for artifacts
id: sha
run: echo "sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Get dev (or draft release) version
id: version
run: |
set -e
echo "full name: ${{ github.event.repository.full_name }}"
if [[ "${{ github.event.client_payload.release_tag }}" != "" ]]; then
echo "version=${{ github.event.client_payload.release_tag }}" >> $GITHUB_OUTPUT
else
echo "version=dev-${{ steps.date.outputs.date }}-${{ steps.sha.outputs.sha }}" >> $GITHUB_OUTPUT
fi
- name: Build RG351MP
run: |
set -e
export CUSTOM_VERSION="${{ steps.version.outputs.version }}"
make DOCKER_WORK_DIR=/work docker-RG351MP
build-rg552:
needs: [build-init, build-rg351p, build-rg351v, build-rg351mp]
timeout-minutes: 360
runs-on: main
steps:
- name: Get date for artifacts
id: date
run: echo "date=$(date +'%Y%m%d_%H%M')" >> $GITHUB_OUTPUT
- name: Get short SHA for artifacts
id: sha
run: echo "sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Get dev (or draft release) version
id: version
run: |
set -e
echo "full name: ${{ github.event.repository.full_name }}"
if [[ "${{ github.event.client_payload.release_tag }}" != "" ]]; then
echo "version=${{ github.event.client_payload.release_tag }}" >> $GITHUB_OUTPUT
else
echo "version=dev-${{ steps.date.outputs.date }}-${{ steps.sha.outputs.sha }}" >> $GITHUB_OUTPUT
fi
- name: Build RG552
run: |
set -e
export CUSTOM_VERSION="${{ steps.version.outputs.version }}"
make DOCKER_WORK_DIR=/work docker-RG552
build-finalize:
needs: [build-init, build-rg351p, build-rg351v, build-rg351mp, build-rg552]
timeout-minutes: 360
runs-on: main
steps:
- name: Get date for artifacts
id: date
run: echo "date=$(date +'%Y%m%d_%H%M')" >> $GITHUB_OUTPUT
- name: Get short SHA for artifacts
id: sha
run: echo "sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
- name: Get dev (or draft release) version
id: version
run: |
set -e
echo "full name: ${{ github.event.repository.full_name }}"
if [[ "${{ github.event.client_payload.release_tag }}" != "" ]]; then
echo "version=${{ github.event.client_payload.release_tag }}" >> $GITHUB_OUTPUT
else
echo "version=dev-${{ steps.date.outputs.date }}-${{ steps.sha.outputs.sha }}" >> $GITHUB_OUTPUT
fi
- name: Cleanup system artifacts
run: |
set -e
rm -rf release/aarch64/RG*/*.system*
rm -rf release/aarch64/RG*/*.kernel*
- name: Cleanup system artifacts (no .img in non-release 'main' builds)
if: github.event.client_payload.release_tag == ''
run: |
set -e
#main builds only include the .tar for speed
rm -rf release/aarch64/RG*/*.img.gz*
- name: Archive RG351V (${{github.sha}})
uses: actions/upload-artifact@v4
if: github.event.client_payload.release_tag == ''
with:
name: RG351V-dev-main-${{ steps.date.outputs.date }}-${{steps.sha.outputs.sha}}
path: |
release/aarch64/RG351V/
- name: Archive RG351P (${{github.sha}})
if: github.event.client_payload.release_tag == ''
uses: actions/upload-artifact@v4
with:
name: RG351P-dev-main-${{ steps.date.outputs.date }}-${{steps.sha.outputs.sha}}
path: |
release/aarch64/RG351P/
- name: Archive RG351MP (${{github.sha}})
if: github.event.client_payload.release_tag == ''
uses: actions/upload-artifact@v4
with:
name: RG351MP-dev-main-${{ steps.date.outputs.date }}-${{steps.sha.outputs.sha}}
path: |
release/aarch64/RG351MP/
- name: Archive RG552 (${{github.sha}})
if: github.event.client_payload.release_tag == ''
uses: actions/upload-artifact@v4
with:
name: RG552-dev-main-${{ steps.date.outputs.date }}-${{steps.sha.outputs.sha}}
path: |
release/aarch64/RG552/
- name: Create pre-release as draft at first to hide during uploads
if: github.event.action == 'release-prerelease'
uses: ncipollo/[email protected]
with:
tag: "${{ steps.version.outputs.version }}"
body: |
# Release Notes (Prerelease)
This is a prerelease based on the commit: ${{ github.event.repository.full_name }}@${{github.sha}}.
Prereleases are provided for the community to test fixes and explore new functionality. Please DO NOT open issues on this build and instead post in the `#pre-release-feedback` section on our Discord server.
See our [website](https://amberelec.org/contributing/contributing-to-amberelec) for more info.
### Changes (since last prerelease version):
${{ github.event.client_payload.release_notes }}
### Upgrade Instructions
You can update to this release using the `prerelease` channel on your device. This is the recommended way to use prerelease versions.
If you want to manually update, download the matching .tar from below and place it on your devices update folder (`GAMES/update` or `/roms/update`) on your microSD card (slot 2 if you use two cards).
> [!CAUTION]
> Do not replace or rename any of the `.dtb` files after flashing a new image or updating from an older AmberELEC release.
> To simplify the process and reduce complexity, we're determining which display the device is using, so no manual interaction is necessary.
<!--devices-->
<table>
<tr>
<td align="center" width="150" nowrap="nowrap">Manufacturer</i></td>
<td align="center" width="150" nowrap="nowrap">Device</td>
<td align="center" width="120" nowrap="nowrap">New Installation</td>
<td align="center" width="120" nowrap="nowrap">Upgrade</td>
</tr>
<tr>
<td rowspan="5">Anbernic</td>
<td>RG351P</td>
<td rowspan="2" align="center"><a href="https://github.com/${{ github.event.repository.owner.login }}/AmberELEC-prerelease/releases/download/${{ steps.version.outputs.version }}/AmberELEC-RG351P.aarch64-${{ steps.version.outputs.version }}.img.gz">Link</a></td>
<td rowspan="2" align="center"><a href="https://github.com/${{ github.event.repository.owner.login }}/AmberELEC-prerelease/releases/download/${{ steps.version.outputs.version }}/AmberELEC-RG351P.aarch64-${{ steps.version.outputs.version }}.tar">Link</a></td>
</tr>
<tr>
<td>RG351M</td>
</tr>
<tr>
<td>RG351V</td>
<td align="center"><a href="https://github.com/${{ github.event.repository.owner.login }}/AmberELEC-prerelease/releases/download/${{ steps.version.outputs.version }}/AmberELEC-RG351V.aarch64-${{ steps.version.outputs.version }}.img.gz">Link</a></td>
<td align="center"><a href="https://github.com/${{ github.event.repository.owner.login }}/AmberELEC-prerelease/releases/download/${{ steps.version.outputs.version }}/AmberELEC-RG351V.aarch64-${{ steps.version.outputs.version }}.tar">Link</a></td>
</tr>
<tr>
<td>RG351MP</td>
<td align="center"><a href="https://github.com/${{ github.event.repository.owner.login }}/AmberELEC-prerelease/releases/download/${{ steps.version.outputs.version }}/AmberELEC-RG351MP.aarch64-${{ steps.version.outputs.version }}.img.gz">Link</a></td>
<td align="center"><a href="https://github.com/${{ github.event.repository.owner.login }}/AmberELEC-prerelease/releases/download/${{ steps.version.outputs.version }}/AmberELEC-RG351MP.aarch64-${{ steps.version.outputs.version }}.tar">Link</a></td>
</tr>
<tr>
<td>RG552</td>
<td align="center"><a href="https://github.com/${{ github.event.repository.owner.login }}/AmberELEC-prerelease/releases/download/${{ steps.version.outputs.version }}/AmberELEC-RG552.aarch64-${{ steps.version.outputs.version }}.img.gz">Link</a></td>
<td align="center"><a href="https://github.com/${{ github.event.repository.owner.login }}/AmberELEC-prerelease/releases/download/${{ steps.version.outputs.version }}/AmberELEC-RG552.aarch64-${{ steps.version.outputs.version }}.tar">Link</a></td>
</tr>
<tr>
<td rowspan="2">PowKiddy</td>
<td>RGB20S</td>
<td rowspan="5" align="center"><a href="https://github.com/${{ github.event.repository.owner.login }}/AmberELEC-prerelease/releases/download/${{ steps.version.outputs.version }}/AmberELEC-RG351MP.aarch64-${{ steps.version.outputs.version }}.img.gz">Link</a></td>
<td rowspan="5" align="center"><a href="https://github.com/${{ github.event.repository.owner.login }}/AmberELEC-prerelease/releases/download/${{ steps.version.outputs.version }}/AmberELEC-RG351MP.aarch64-${{ steps.version.outputs.version }}.tar">Link</a></td>
</tr>
<tr>
<td>Magicx XU10</td>
</tr>
<tr>
<td rowspan="3">Game Console<br />Game Station</td>
<td>R33S</td>
</tr>
<tr>
<td>R35S</td>
</tr>
<tr>
<td>R36S</td>
</tr>
</table>
<!--devices-->
artifacts: "release/aarch64/RG351P/*, release/aarch64/RG351V/*, release/aarch64/RG351MP/*, release/aarch64/RG552/*"
prerelease: true
draft: true
token: ${{ secrets.TRIGGER_BUILD_TOKEN }}
repo: AmberELEC-prerelease
- name: Switch draft to start showing release
if: github.event.action == 'release-prerelease'
uses: ncipollo/[email protected]
with:
tag: "${{ steps.version.outputs.version }}"
allowUpdates: true
draft: false
prerelease: true
token: ${{ secrets.TRIGGER_BUILD_TOKEN }}
repo: AmberELEC-prerelease
omitBodyDuringUpdate: true
omitNameDuringUpdate: true
- name: Create dev release as draft at first to hide during uploads
if: github.event.action == 'release-dev'
uses: ncipollo/[email protected]
with:
tag: "${{ steps.version.outputs.version }}"
body: |
# Release Notes (Dev - Unsupported)
This is an **unsupported dev release** based on the commit: ${{ github.event.repository.full_name }}@${{github.sha}}.
Unless you were asked by a developer to use this build or **are** a developer. **Do not use this build.**
### Changes (since last dev build):
${{ github.event.client_payload.release_notes }}
### Upgrade Instructions
You can update to this release using the `prerelease` channel on your device if you take the following steps:
- Under`System Settings` -> `Developer` (`Updates` section), set the following:
-`GITHUB ORG` = `351dev`
-`GITHUB REPO` = `builds`
artifacts: "release/aarch64/RG351P/*, release/aarch64/RG351V/*, release/aarch64/RG351MP/*, release/aarch64/RG552/*"
prerelease: true
draft: true
token: ${{ secrets.TRIGGER_DEV_BUILD_TOKEN }}
owner: 351dev
repo: dev-builds
- name: Switch draft to start showing release
if: github.event.action == 'release-dev'
uses: ncipollo/[email protected]
with:
tag: "${{ steps.version.outputs.version }}"
allowUpdates: true
draft: false
prerelease: true
token: ${{ secrets.TRIGGER_DEV_BUILD_TOKEN }}
owner: 351dev
repo: dev-builds
omitBodyDuringUpdate: true
omitNameDuringUpdate: true
#This can be removed after no more 'bridge' betas are needed
- name: Create pre-release as draft at first to hide during uploads
if: github.event.action == 'release-beta'
uses: ncipollo/[email protected]
with:
tag: "${{ steps.version.outputs.version }}"
body: |
# Release Notes (Beta)
This beta is provided as a OTA bridge to the new pre-releases
### Upgrade Instructions
You can update to this release using the `beta` channel on your device. This is the recommended way to use beta versions.
**IMPORTANT NOTE**: There are **three different images** below, one for the **RG351P/M**, **RG351V** and **RG351MP**!
**If you download the incorrect image for your device, it will not boot!** If you are unsure, use the the following links:
**New Installations** (`.img.gz`): **[RG351P/M](https://github.com/${{ github.event.repository.owner.login }}/AmberELEC-prerelease/releases/download/${{ steps.version.outputs.version }}/AmberELEC-RG351P.aarch64-${{ steps.version.outputs.version }}.img.gz)** | **[RG351V](https://github.com/${{ github.event.repository.owner.login }}/AmberELEC-prerelease/releases/download/${{ steps.version.outputs.version }}/AmberELEC-RG351V.aarch64-${{ steps.version.outputs.version }}.img.gz)** | **[RG351MP](https://github.com/${{ github.event.repository.owner.login }}/AmberELEC-prerelease/releases/download/${{ steps.version.outputs.version }}/AmberELEC-RG351MP.aarch64-${{ steps.version.outputs.version }}.img.gz)**
**Upgrades** (place in `/storage/roms/update`): **[RG351P/M](https://github.com/${{ github.event.repository.owner.login }}/AmberELEC-prerelease/releases/download/${{ steps.version.outputs.version }}/AmberELEC-RG351P.aarch64-${{ steps.version.outputs.version }}.tar)** | **[RG351V](https://github.com/${{ github.event.repository.owner.login }}/AmberELEC-prerelease/releases/download/${{ steps.version.outputs.version }}/AmberELEC-RG351V.aarch64-${{ steps.version.outputs.version }}.tar)** | **[RG351MP](https://github.com/${{ github.event.repository.owner.login }}/AmberELEC-prerelease/releases/download/${{ steps.version.outputs.version }}/AmberELEC-RG351MP.aarch64-${{ steps.version.outputs.version }}.tar)**
artifacts: "release/aarch64/RG351P/*, release/aarch64/RG351V/*, release/aarch64/RG351MP/*, release/aarch64/RG552/*"
prerelease: true
draft: true
token: ${{ secrets.TRIGGER_BUILD_TOKEN }}
repo: AmberELEC-prerelease
- name: Switch draft to start showing release
if: github.event.action == 'release-beta'
uses: ncipollo/[email protected]
with:
tag: "${{ steps.version.outputs.version }}"
allowUpdates: true
draft: false
prerelease: true
token: ${{ secrets.TRIGGER_BUILD_TOKEN }}
repo: AmberELEC-prerelease
omitBodyDuringUpdate: true
omitNameDuringUpdate: true
- name: Create draft release
uses: softprops/action-gh-release@v1
if: github.event.action == 'release-draft'
with:
tag_name: "${{ steps.version.outputs.version }}"
name: "AmberELEC - ${{ steps.version.outputs.version }} - ${{ github.event.client_payload.release_name }}"
body: |
# Release Notes
Welcome to the ${{ github.event.client_payload.release_name}} (${{ steps.version.outputs.version }}) release.
General:
New Stuff:
Fixes:
**IMPORTANT NOTE**: There are **four different images** below, one for the **RG351P/M**, **RG351V**, **RG351MP** and **RG552**!
**If you download the incorrect image for your device, it will not boot!** If you are unsure, use the the following links:
**New Installations** (`.img.gz`): **[RG351P/M](https://github.com/${{ github.event.repository.full_name }}/releases/download/${{ steps.version.outputs.version }}/AmberELEC-RG351P.aarch64-${{ steps.version.outputs.version }}.img.gz)** | **[RG351V](https://github.com/${{ github.event.repository.full_name }}/releases/download/${{ steps.version.outputs.version }}/AmberELEC-RG351V.aarch64-${{ steps.version.outputs.version }}.img.gz)** | **[RG351MP](https://github.com/${{ github.event.repository.full_name }}/releases/download/${{ steps.version.outputs.version }}/AmberELEC-RG351MP.aarch64-${{ steps.version.outputs.version }}.img.gz)** | **[RG552](https://github.com/${{ github.event.repository.full_name }}/releases/download/${{ steps.version.outputs.version }}/AmberELEC-RG552.aarch64-${{ steps.version.outputs.version }}.img.gz)**
**Upgrades** (place in `/storage/roms/update`): **[RG351P/M](https://github.com/${{ github.event.repository.full_name }}/releases/download/${{ steps.version.outputs.version }}/AmberELEC-RG351P.aarch64-${{ steps.version.outputs.version }}.tar)** | **[RG351V](https://github.com/${{ github.event.repository.full_name }}/releases/download/${{ steps.version.outputs.version }}/AmberELEC-RG351V.aarch64-${{ steps.version.outputs.version }}.tar)** | **[RG351MP](https://github.com/${{ github.event.repository.full_name }}/releases/download/${{ steps.version.outputs.version }}/AmberELEC-RG351MP.aarch64-${{ steps.version.outputs.version }}.tar)** | **[RG552](https://github.com/${{ github.event.repository.full_name }}/releases/download/${{ steps.version.outputs.version }}/AmberELEC-RG552.aarch64-${{ steps.version.outputs.version }}.tar)**
files: |
release/aarch64/RG351P/*
release/aarch64/RG351V/*
release/aarch64/RG351MP/*
release/aarch64/RG552/*
prerelease: true
draft: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}