Skip to content

Commit

Permalink
Update workflows
Browse files Browse the repository at this point in the history
This will build all platforms and configurations on every push or pull request to master.
Creating version tags will rebuild and draft a new release.
  • Loading branch information
mariobalanica committed Mar 26, 2023
1 parent f386fdb commit 8bb27dd
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 52 deletions.
79 changes: 27 additions & 52 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,50 +3,26 @@ on:
push:
branches:
- master
- github-workflow
pull_request:
branches:
- master
workflow_call:

jobs:
prepare_release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Get time
id: time
uses: nanzm/[email protected]
with:
format: 'YYYYMMDD-HHmm'
- name: Create empty release
id: release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.time.outputs.time }}
body_path: README.md
token: ${{ secrets.GITHUB_TOKEN }}
target_commitish: master
draft: false
outputs:
release_id: ${{ steps.release.outputs.id }}
build:
runs-on: ubuntu-latest
needs: prepare_release
permissions:
contents: write
strategy:
matrix:
PLATFORM: [rock-5b, orangepi-5] # rk3588-evb is currently failing
CONFIGURATION: [Debug, Release]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install and cache packages
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: luajit
version: 1.0
- name: Submodule init
shell: bash
run: |
git submodule update --init --recursive
- name: Install deps
run: git submodule update --init --recursive

- name: Install dependencies
shell: bash
run: |
sudo apt-get install -y \
Expand All @@ -60,22 +36,21 @@ jobs:
libc6-dev-arm64-cross \
python3 \
python3-pyelftools
- name: Install deps
- name: Get version tag
id: get_version_tag
shell: bash
run: |
./build.sh -d rock-5b
- name: Upload
uses: xresloader/upload-to-github-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
release_id: ${{ needs.prepare_release.outputs.release_id }}
file: "./*.img"
draft: false
- name: Rollback release
if: failure()
uses: author/action-rollback@stable
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: echo "version=$(git describe --tags --always)" >> $GITHUB_OUTPUT

- name: Build platform
shell: bash
run: |
./build.sh --device ${{matrix.PLATFORM}} --release ${{matrix.CONFIGURATION}}
mv RK3588_NOR_FLASH.img ${{matrix.PLATFORM}}_UEFI_${{matrix.CONFIGURATION}}_${{steps.get_version_tag.outputs.version}}.img
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
release_id: ${{ needs.prepare_release.outputs.release_id }}
name: ${{matrix.PLATFORM}} UEFI ${{matrix.CONFIGURATION}} image
path: ./*.img
if-no-files-found: error
34 changes: 34 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Release
on:
push:
tags:
- '*'

jobs:
build_for_release:
uses: ./.github/workflows/build.yml

release:
runs-on: ubuntu-latest
needs: build_for_release
permissions:
contents: write
steps:
- name: Download all workflow run artifacts
uses: actions/download-artifact@v3

- name: Create release
uses: softprops/action-gh-release@v1
with:
draft: true
prerelease: false
files: "*/*Release*.img"
fail_on_unmatched_files: true
generate_release_notes: true
append_body: true
body: |
## Usage
Flash the board-specific image to SPINOR with rkdevtool / rkdeveloptool or to an EMMC / SD card.
If your board is not yet supported, using a similar image may work but beware of potential issues.
Debug builds can be found in the artifacts of the workflow run for this release.

0 comments on commit 8bb27dd

Please sign in to comment.