diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f060114df..f74b85c5c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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/get-time-action@v1.1 - 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 \ @@ -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 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 000000000..81a6bc5aa --- /dev/null +++ b/.github/workflows/release.yml @@ -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.