build: Add option TEST_BUILD

This commit is contained in:
remittor
2025-02-09 11:35:01 +03:00
parent b73f7e93d6
commit c524434b43

View File

@@ -3,6 +3,14 @@ name: build
on: on:
workflow_dispatch: workflow_dispatch:
inputs: inputs:
test_build:
description: 'Test build'
required: false
default: 'false'
type: choice
options:
- true
- false
fake_build: fake_build:
description: 'Fake build' description: 'Fake build'
required: false required: false
@@ -24,9 +32,10 @@ on:
- v[0-9]+* - v[0-9]+*
env: env:
TEST_BUILD: ${{ github.event.inputs.test_build == 'true' }}
FAKE_BUILD: ${{ github.event.inputs.fake_build == 'true' }} FAKE_BUILD: ${{ github.event.inputs.fake_build == 'true' }}
MAX_SPEED: ${{ github.event.inputs.max_speed != 'false' }} MAX_SPEED: ${{ github.event.inputs.max_speed != 'false' }}
TAG_SUFFIX: ${{ github.event.inputs.fake_build == 'true' && '-fake' || '' }} TAG_SUFFIX: ${{ github.event.inputs.fake_build == 'true' && '-fake' || github.event.inputs.test_build == 'true' && '-test' || '' }}
REPO_URL: https://github.com/remittor/zapret-openwrt REPO_URL: https://github.com/remittor/zapret-openwrt
REPO_LNK: remittor/zapret-openwrt REPO_LNK: remittor/zapret-openwrt
REPO_BRANCH: master REPO_BRANCH: master
@@ -47,6 +56,8 @@ jobs:
build_date: ${{ steps.gh.outputs.build_date }} build_date: ${{ steps.gh.outputs.build_date }}
fw_date: ${{ steps.gh.outputs.fw_date }} fw_date: ${{ steps.gh.outputs.fw_date }}
is_active: ${{ steps.activity.outputs.is_active }} is_active: ${{ steps.activity.outputs.is_active }}
test_build: ${{ env.TEST_BUILD }}
fake_build: ${{ env.FAKE_BUILD }}
steps: steps:
- name: Get repo data via GH API - name: Get repo data via GH API
id: gh id: gh
@@ -127,14 +138,14 @@ jobs:
- mipsel_74kc - mipsel_74kc
- mipsel_mips32 - mipsel_mips32
- x86_64 - x86_64
isFake: isTestOrFake:
- ${{ env.FAKE_BUILD }} - ${{ needs.check.outputs.test_build == 'true' || needs.check.outputs.fake_build == 'true' }}
exclude: exclude:
- branch: SNAPSHOT - branch: SNAPSHOT
arch: arm_mpcore arch: arm_mpcore
- branch: SNAPSHOT - branch: SNAPSHOT
arch: arm_cortex-a9_vfpv3-d16 arch: arm_cortex-a9_vfpv3-d16
- { isFake: true } - { isTestOrFake: true }
include: include:
- branch: openwrt-23.05 - branch: openwrt-23.05
arch: x86_64 arch: x86_64
@@ -188,6 +199,7 @@ jobs:
id: build id: build
working-directory: '/builder' working-directory: '/builder'
env: env:
FAKE_BUILD: ${{ env.FAKE_BUILD == 'true' || ( env.TEST_BUILD == 'true' && matrix.branch == 'SNAPSHOT' ) }}
BUILD_DATE: ${{ needs.check.outputs.build_date }} BUILD_DATE: ${{ needs.check.outputs.build_date }}
DATE: ${{ needs.check.outputs.date }} DATE: ${{ needs.check.outputs.date }}
SHA: ${{ needs.check.outputs.sha }} SHA: ${{ needs.check.outputs.sha }}
@@ -211,7 +223,7 @@ jobs:
sed -i -e 's|luci.*\.git|luci https://github.com/openwrt/luci.git|' feeds.conf sed -i -e 's|luci.*\.git|luci https://github.com/openwrt/luci.git|' feeds.conf
mkdir -p ./logs mkdir -p ./logs
if [ "$FAKE_BUILD" != "true" ]; then if [ "$FAKE_BUILD" = "false" ]; then
./scripts/feeds update base packages luci ./scripts/feeds update base packages luci
./scripts/feeds install -a ./scripts/feeds install -a
make defconfig make defconfig
@@ -316,7 +328,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAG: ${{ needs.check.outputs.tag }} TAG: ${{ needs.check.outputs.tag }}
with: with:
prerelease: ${{ env.FAKE_BUILD }} prerelease: ${{ env.TEST_BUILD == 'true' || env.FAKE_BUILD == 'true' }}
tag_name: v${{ needs.build.outputs.pkgver }}${{ env.TAG_SUFFIX }} tag_name: v${{ needs.build.outputs.pkgver }}${{ env.TAG_SUFFIX }}
name: zapret v${{ needs.build.outputs.pkgver }} name: zapret v${{ needs.build.outputs.pkgver }}
body: | body: |