Skip to content

Commit

Permalink
Add initial GitHub Actions workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
ayufan committed Sep 27, 2022
1 parent c783627 commit 2d50ac6
Showing 1 changed file with 64 additions and 0 deletions.
64 changes: 64 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
on: [push]

env:
RELEASE_START: 1150 # 1150, as this is latest build by GitLab CI
CCACHE_DIR: $RUNNER_TEMP/ccache

jobs:
build:
runs-on: [self-hosted, Linux, ARM64]
container: ayufan/rock64-dockerfiles:arm64
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Docker binary
run: |
apt-get -y update
apt-get -y install docker.io
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Reset ccache statistics
run: ccache -M 0 -F 0
- name: Build package
run: |
export RELEASE=$(($RELEASE_START+$GITHUB_RUN_NUMBER))
./dev-make kernel-package
- 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)"
export RELEASE_TITLE="$(./dev-make version)"
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 ../*$(./dev-make info)*.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}"
rm ../*$(./dev-make info)*.deb

0 comments on commit 2d50ac6

Please sign in to comment.