workflow: fix version string to follow VERSION-NB #6
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
on: | |
push: | |
workflow_dispatch: | |
env: | |
RELEASE_START: 100 | |
jobs: | |
build: | |
runs-on: [self-hosted, Linux, ARM64] | |
container: | |
image: ayufan/rock64-dockerfiles:bookworm | |
options: --privileged | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Configure version | |
run: echo "VERSION=$(cat VERSION)-$(($RELEASE_START+$GITHUB_RUN_NUMBER))" >> $GITHUB_ENV | |
- name: Cleanup old packages | |
run: rm -f *.tar.xz | |
- name: Install keyring | |
run: make keyring | |
- name: Build images | |
run: make all | |
- name: Release images | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
set -x | |
export RELEASE_NAME="$VERSION" | |
export RELEASE_TITLE="$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 *.tar.xz; 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}" |