fix: fix run build job

This commit is contained in:
Svyatoslav Shchipunov
2024-10-02 11:29:03 +07:00
parent 47c3466084
commit 66b6a8f7ce
2 changed files with 21 additions and 6 deletions

View File

@@ -1,13 +1,17 @@
name: Create Release on Tag
on:
release:
types:
- published
push:
tags:
- "v*.*.*"
workflow_call:
inputs:
tag_name:
required: true
type: string
jobs:
generate-config:
if: github.event.release.tag_name =~ '^v[0-9]+\.[0-9]+\.[0-9]+$' # Условие для проверки формата тега
runs-on: ubuntu-latest
outputs:
job-config: ${{ steps.generate-config.outputs.job-config }}
@@ -22,7 +26,12 @@ jobs:
- name: Get OpenWRT version from tag
id: get_version
run: echo "VERSION=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_ENV
run: |
if [ "${{ github.event_name }}" == "workflow_call" ]; then
echo "VERSION=${{ inputs.tag_name/v/}}" >> $GITHUB_ENV
else
echo "VERSION=${GITHUB_REF/refs/tags/v/}" >> $GITHUB_ENV
fi
- name: Install dependencies
run: npm install

View File

@@ -52,4 +52,10 @@ jobs:
-d "$(jq -n --arg tag "${{ steps.get_release.outputs.release_tag }}" \
--arg name "Build amnezia wg for all devices with openwrt ${{ steps.get_release.outputs.release_tag }}" \
--arg body "$ART" \
'{ tag_name: $tag, name: $name, body: $body }')"
'{ tag_name: $tag, name: $name, body: $body }')"
- name: Run build job
if: steps.check_release.outputs.release_exists == 'false'
uses: .github/workflows/build-module.yml
with:
tag_name: ${{ steps.get_release.outputs.release_tag }}