Skip to content

Commit 41917e7

Browse files
committed
ci: simplyify tag logic
- Remove pre_release input - master branch builds are always set to latest (non pre-releases) - Fixed title of Telegram CI messages and make them clearer Signed-off-by: TheSillyOk <priv.ld@proton.me>
1 parent a2e9a51 commit 41917e7

1 file changed

Lines changed: 11 additions & 8 deletions

File tree

.github/workflows/build_kernels.yml

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,6 @@ name: Kernel Build
33
on:
44
workflow_dispatch:
55
inputs:
6-
pre_release:
7-
description: 'Make it a prerelease?'
8-
required: false
9-
type: boolean
10-
default: true
116
workflow_call:
127
inputs:
138
scheduled:
@@ -271,10 +266,18 @@ jobs:
271266
id: release_vars
272267
run: |
273268
echo "date=$(date +"%d/%m/%Y")" >> $GITHUB_ENV
274-
echo "tg_title=${{ github.event.inputs.scheduled == 'true' && 'A new scheduled build has been completed!' || 'A new kernel CI release has been completed!' }}" >> $GITHUB_ENV
275269
echo "run_url=${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" >> $GITHUB_ENV
276270
echo "nightly_url=https://nightly.link/${{ github.repository }}/actions/runs/${{ github.run_id }}" >> $GITHUB_ENV
277271
272+
if [ -n "${{ inputs.scheduled_build }}" ]; then
273+
title="A new scheduled build has been made. (SCHEDULED BUILD)"
274+
elif [ ${{ github.ref_name == 'master' }} ]; then
275+
title="A new tag release has been made. (STABLE BUILD)"
276+
else
277+
title="A new test build has been made. (TEST BUILD)"
278+
fi
279+
echo "tg_title=$title" >> $GITHUB_ENV
280+
278281
KSUN_URL=$(git ls-remote https://github.com/KernelSU-Next/KernelSU-Next.git HEAD | awk '{print "https://github.com/KernelSU-Next/KernelSU-Next/commit/"$1}')
279282
RKSU_URL=$(git ls-remote https://github.com/rsuntk/KernelSU HEAD | awk '{print "https://github.com/rsuntk/KernelSU/commit/"$1}')
280283
echo "KSUN_URL=$KSUN_URL" >> $GITHUB_ENV
@@ -325,7 +328,7 @@ jobs:
325328
echo "repo_dir=$PWD" >> $GITHUB_ENV
326329
327330
if [ "${{ github.ref_type }}" != "tag" ]; then
328-
if [[ "${{ inputs.pre_release }}" != "false" || "${{ github.ref_name }}" != "master" ]]; then
331+
if [[ "${{ github.ref_name }}" != "master" ]]; then
329332
TAG=$(date +"%Y/%m/%d")-test
330333
gh release delete "$TAG" -y || true
331334
else
@@ -362,7 +365,7 @@ jobs:
362365
tag_name: ${{ env.TAG }}
363366
name: ${{ env.date }}
364367
body_path: release_body.md
365-
prerelease: ${{ github.ref_name != 'master' || inputs.pre_release != 'false' }}
368+
prerelease: ${{ github.ref_name != 'master' }}
366369

367370
- name: Upload Release Assets
368371
env:

0 commit comments

Comments
 (0)