From faa9ee2c514e18ae8e9d87624c21cb45ab65d392 Mon Sep 17 00:00:00 2001 From: Kamil Trzcinski Date: Fri, 10 Nov 2023 10:09:05 +0100 Subject: [PATCH] Add GitHub Actions --- .github/pull_request_template.md | 6 ++++ .github/workflows/build.yaml | 61 ++++++++++++++++++++++++++++++++ .gitlab-ci.yml | 44 ----------------------- 3 files changed, 67 insertions(+), 44 deletions(-) create mode 100644 .github/pull_request_template.md create mode 100644 .github/workflows/build.yaml delete mode 100644 .gitlab-ci.yml diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..7728104 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,6 @@ +Please do not submit a Pull Request via github. Our project makes use of +mailing lists for patch submission and review. For more details please +see https://u-boot.readthedocs.io/en/latest/develop/sending_patches.html + +The only exception to this is in order to trigger a CI loop on Azure prior +to posting of patches. diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 0000000..bcdbd3c --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,61 @@ +on: [push] + +env: + RELEASE_START: 213 + CCACHE_DIR: $RUNNER_TEMP/ccache + +jobs: + build: + runs-on: [self-hosted, Linux, ARM64] + container: ayufan/rock64-dockerfiles:bookworm + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Reset ccache statistics + run: ccache -M 0 -F 0 + - name: Build package + run: | + export RELEASE=$(($RELEASE_START+$GITHUB_RUN_NUMBER)) + rm -f ../*.deb + make BOARD_TARGET=rock64 + make BOARD_TARGET=rockpro64 + make BOARD_TARGET=rockpi4b + make BOARD_TARGET=rockpi5b + make BOARD_TARGET=pinebookpro + - name: Release package + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + set -x + + export RELEASE=$(($RELEASE_START+$GITHUB_RUN_NUMBER)) + export RELEASE_NAME="$(./dev-make version BOARD_TARGET=rock64)" + export RELEASE_TITLE="$(./dev-make version BOARD_TARGET=rock64)" + export DESCRIPTION="$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" + + github-release release \ + --tag "${RELEASE_NAME}" \ + --name "${RELEASE_TITLE}" \ + --user "${GITHUB_REPOSITORY%/*}" \ + --repo "${GITHUB_REPOSITORY#*/}" \ + --description "${DESCRIPTION}" \ + --target "${GITHUB_SHA}" \ + --draft + + sleep 3s # allow to update release + + for i in *.deb; do + github-release upload \ + --tag "${RELEASE_NAME}" \ + --name "$(basename "${i}")" \ + --user "${GITHUB_REPOSITORY%/*}" \ + --repo "${GITHUB_REPOSITORY#*/}" \ + --file "${i}" + done + + github-release edit \ + --tag "${RELEASE_NAME}" \ + --name "${RELEASE_TITLE}" \ + --user "${GITHUB_REPOSITORY%/*}" \ + --repo "${GITHUB_REPOSITORY#*/}" \ + --description "${DESCRIPTION}" diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index 3f80c75..0000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,44 +0,0 @@ -image: ayufan/rock64-dockerfiles:bookworm - -variables: - GITHUB_USER: ayufan-rock64 - GITHUB_REPO: linux-package - -stages: [build] - -build: - stage: build - only: [branches] - script: - - export RELEASE="$CI_PIPELINE_IID" - - chmod go-w -R . # fix umask, as GitLab CI uses 0000 - - make BOARD_TARGET=rock64 - - make BOARD_TARGET=rockpro64 - - make BOARD_TARGET=rockpi4b - - make BOARD_TARGET=rockpi5b - - make BOARD_TARGET=pinebookpro - - | - set -x - - export RELEASE_NAME="$(make version BOARD_TARGET=rock64)" - export RELEASE_TITLE="$(make release BOARD_TARGET=rock64)" - export DESCRIPTION="$CI_PROJECT_URL/pipelines/$CI_PIPELINE_ID" - - github-release release \ - --tag "${RELEASE_NAME}" \ - --name "${RELEASE_TITLE}" \ - --description "${DESCRIPTION}" \ - --target "${CI_COMMIT_SHA}" \ - --draft - - for i in *.deb; do - github-release upload \ - --tag "${RELEASE_NAME}" \ - --name "${i}" \ - --file "${i}" - done - - github-release edit \ - --tag "${RELEASE_NAME}" \ - --name "${RELEASE_TITLE}" \ - --description "${DESCRIPTION}"