π· PR #28 build - Bump actions/download-artifact from 4.1.3 to 4.1.7 #39
Workflow file for this run
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
name: HyperBian CI/Release Build | |
run-name: | | |
${{ github.event_name == 'push' && format('π± Push build - {0}', github.event.head_commit.message) || '' }} | |
${{ github.event_name == 'pull_request' && format('π· PR #{0} build - {1}', github.event.pull_request.number, github.event.pull_request.title) || '' }} | |
${{ github.event_name == 'repository_dispatch' && 'π Triggered HyperBian build' || '' }} | |
${{ github.event_name == 'workflow_dispatch' && 'π Manual triggered HyperBian build' || '' }} | |
on: | |
push: | |
branches: | |
- '**' | |
pull_request: | |
branches: | |
- 'master' | |
workflow_dispatch: | |
repository_dispatch: | |
types: [ hyperion_push ] | |
env: | |
PLATFORM: bookworm | |
jobs: | |
image-builder: | |
name: "HyperBian (${{ matrix.pi-gen.architecture }})" | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
pi-gen: [ | |
{ branch: master, architecture: armhf }, | |
{ branch: arm64, architecture: arm64 } | |
] | |
steps: | |
- name: β¬ Checkout HyperBian | |
uses: actions/checkout@v4 | |
- name: β¬ Checkout pi-gen | |
uses: actions/checkout@v4 | |
with: | |
repository: RPi-Distro/pi-gen | |
ref: ${{ matrix.pi-gen.branch }} | |
path: pi-gen | |
- name: π§ Prepare | |
run: | | |
sudo apt-get update && sudo apt-get install -y coreutils quilt parted qemu-utils qemu-user-static debootstrap zerofree zip dosfstools libarchive-tools libcap2-bin grep rsync xz-utils file git curl bc kmod kpartx | |
echo "HYPERBIAN=HyperBian-${{ env.PLATFORM }}-${{ matrix.pi-gen.architecture }}" >> $GITHUB_ENV | |
- name: π· Build | |
run: | | |
touch pi-gen/stage3/SKIP pi-gen/stage4/SKIP pi-gen/stage4/SKIP_IMAGES pi-gen/stage5/SKIP pi-gen/stage5/SKIP_IMAGES | |
cp -R stage-hyperbian pi-gen/ | |
touch pi-gen/stage-hyperbian/EXPORT_IMAGE | |
cp config pi-gen/ && cd pi-gen | |
echo "Suites: ${{ env.PLATFORM }}" >> "./stage-hyperbian/00-install-hyperion/files/hyperion.sources" | |
echo "Architectures: ${{ matrix.pi-gen.architecture }}" >> "./stage-hyperbian/00-install-hyperion/files/hyperion.sources" | |
echo "RELEASE='${{ env.PLATFORM }}'" >> "./config" | |
sudo IMG_FILENAME=${{ env.HYPERBIAN }} ARCHIVE_FILENAME=${{ env.HYPERBIAN }} ./build.sh | |
- name: π¦ Upload | |
if: ${{ github.event_name == 'repository_dispatch' || github.event_name == 'workflow_dispatch' || github.event_name == 'pull_request' }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ env.HYPERBIAN }} | |
path: pi-gen/deploy/*.zip | |
retention-days: 1 | |
##################################### | |
###### Publish GitHub Releases ###### | |
##################################### | |
github_publish: | |
name: π Publish GitHub Releases | |
if: ${{ github.event_name == 'repository_dispatch' || github.event_name == 'workflow_dispatch' }} | |
needs: [ image-builder ] | |
runs-on: ubuntu-latest | |
steps: | |
- name: β¬ Checkout HyperBian | |
uses: actions/checkout@v4 | |
- name: π§ Prepare | |
id: read_template | |
shell: bash | |
run: | | |
TEMPLATE=$(cat ./.github/workflows/template.md) | |
TEMPLATE="${TEMPLATE//'%'/'%25'}" | |
TEMPLATE="${TEMPLATE//$'\n'/'%0A'}" | |
TEMPLATE="${TEMPLATE//$'\r'/'%0D'}" | |
echo "RELEASE_BODY=$TEMPLATE" >> "$GITHUB_OUTPUT" | |
- name: πΎ Artifact download | |
uses: actions/[email protected] | |
with: | |
pattern: HyperBian-* | |
path: all-artifacts | |
merge-multiple: true | |
- name: Delete previous HyperBian Release | |
uses: dev-drprasad/[email protected] | |
with: | |
keep_latest: 0 | |
delete_tags: true | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Create release and upload image | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
file_glob: true | |
file: all-artifacts/* | |
tag: HyperBian | |
release_name: HyperBian | |
overwrite: true | |
body: | | |
${{ steps.read_template.outputs.RELEASE_BODY }} |