feat(release): update release workflow to trigger on tag pushes (#6093)

This commit is contained in:
cuisongliu
2025-10-15 19:31:50 +08:00
committed by GitHub
parent def18f01d4
commit 4b58b9ec47
8 changed files with 114 additions and 83 deletions
+33 -65
View File
@@ -1,6 +1,18 @@
name: Release Cloud
on:
workflow_call:
inputs:
tag:
description: "Tag for manual release"
required: false
default: ""
type: string
build_offline_tar_only:
description: "Build offline tar only"
required: false
default: false
type: boolean
workflow_dispatch:
inputs:
tag:
@@ -27,77 +39,33 @@ permissions:
jobs:
release-controllers:
if: ${{ inputs.build_offline_tar_only == false }}
runs-on: ubuntu-24.04
steps:
- name: Trigger Cloud Controller Release Workflow(only when tagged)
uses: actions/github-script@v6
with:
script: |
github.rest.actions.createWorkflowDispatch({
owner: context.repo.owner,
repo: context.repo.repo,
workflow_id: 'controllers.yml',
ref: "refs/tags/${{ github.ref_name }}",
inputs: {
push_image_tag: "${{ github.ref_name }}",
push_image: true
}
})
uses: ./.github/workflows/controllers.yml
with:
push_image: true
push_image_tag: ${{ inputs.tag }}
secrets: inherit
release-frontends:
if: ${{ inputs.build_offline_tar_only == false }}
runs-on: ubuntu-24.04
steps:
- name: Trigger Cloud Frontends Release Workflow(only when tagged)
uses: actions/github-script@v6
with:
script: |
github.rest.actions.createWorkflowDispatch({
owner: context.repo.owner,
repo: context.repo.repo,
workflow_id: 'frontends.yml',
ref: "refs/tags/${{ github.ref_name }}",
inputs: {
push_image_tag: "${{ github.ref_name }}",
push_image: true
}
})
uses: ./.github/workflows/frontends.yml
with:
push_image: true
push_image_tag: ${{ inputs.tag }}
secrets: inherit
release-service:
if: ${{ inputs.build_offline_tar_only == false }}
runs-on: ubuntu-24.04
steps:
- name: Trigger Cloud Services Release Workflow(only when tagged)
uses: actions/github-script@v6
with:
script: |
github.rest.actions.createWorkflowDispatch({
owner: context.repo.owner,
repo: context.repo.repo,
workflow_id: 'services.yml',
ref: "refs/tags/${{ github.ref_name }}",
inputs: {
push_image_tag: "${{ github.ref_name }}",
push_image: true
}
})
uses: ./.github/workflows/services.yml
with:
push_image: true
push_image_tag: ${{ inputs.tag }}
secrets: inherit
release-webhook:
if: ${{ inputs.build_offline_tar_only == false }}
runs-on: ubuntu-24.04
steps:
- name: Trigger Cloud Services Release Workflow(only when tagged)
uses: actions/github-script@v6
with:
script: |
github.rest.actions.createWorkflowDispatch({
owner: context.repo.owner,
repo: context.repo.repo,
workflow_id: 'webhooks.yml',
ref: "refs/tags/${{ github.ref_name }}",
inputs: {
push_image_tag: "${{ github.ref_name }}",
push_image: true
}
})
uses: ./.github/workflows/webhooks.yml
with:
push_image: true
push_image_tag: ${{ inputs.tag }}
secrets: inherit
release-cloud:
if: ${{ inputs.build_offline_tar_only == false }}
needs:
+16
View File
@@ -66,6 +66,22 @@ jobs:
if: ${{ (github.event_name == 'release') ||(github.event_name == 'push') || (inputs.push_image == true) }}
runs-on: ubuntu-24.04
steps:
- name: Free Disk Space (Ubuntu)
uses: BRAINSia/free-disk-space@v2
with:
# this might remove tools that are actually needed,
# if set to "true" but frees about 6 GB
tool-cache: false
# all of these default to true, but feel free to set to
# "false" if necessary for your workflow
mandb: true
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: true
swap-storage: true
- name: Checkout
uses: actions/checkout@v4
with:
+12
View File
@@ -1,6 +1,18 @@
name: Build Controllers image
on:
workflow_call:
inputs:
push_image:
description: "Push image"
required: false
type: boolean
default: false
push_image_tag:
description: "Push image tag"
default: "latest"
required: false
type: string
workflow_dispatch:
inputs:
push_image:
+12
View File
@@ -1,6 +1,18 @@
name: Build Frontends Image
on:
workflow_call:
inputs:
push_image:
description: "Push image"
required: false
type: boolean
default: false
push_image_tag:
description: "Push image tag"
default: "latest"
required: false
type: string
workflow_dispatch:
inputs:
push_image:
+9 -18
View File
@@ -7,6 +7,9 @@ env:
on:
workflow_dispatch:
push:
tags:
- "*"
jobs:
releaser:
@@ -47,27 +50,15 @@ jobs:
USERNAME: ${{ github.repository_owner }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
FURY_TOKEN: ${{ secrets.FURY_TOKEN }}
cloud-release:
runs-on: ubuntu-24.04
uses: ./.github/workflows/cloud-release.yml
needs:
- releaser
permissions:
contents: read
contents: write
packages: write
actions: write
steps:
- name: Trigger Cloud Release Workflow(only when tagged)
uses: actions/github-script@v6
with:
script: |
github.rest.actions.createWorkflowDispatch({
owner: context.repo.owner,
repo: context.repo.repo,
workflow_id: 'cloud-release.yml',
ref: "refs/tags/${{ github.ref_name }}",
inputs: {
tag: "${{ github.ref_name }}",
build_offline_tar_only: false
}
})
secrets: inherit
with:
tag: ${{ github.ref_name }}
build_offline_tar_only: false
+13
View File
@@ -1,6 +1,18 @@
name: Build Services image
on:
workflow_call:
inputs:
push_image:
description: "Push image"
required: false
type: boolean
default: false
push_image_tag:
description: "Push image tag"
default: "latest"
required: false
type: string
workflow_dispatch:
inputs:
push_image:
@@ -49,6 +61,7 @@ jobs:
run: bash scripts/resolve-modules.sh ./service
golangci-lint:
if: ${{ github.event_name }} == 'push' || ${{ github.event_name }} == 'pull_request'
needs: [resolve-modules]
runs-on: ubuntu-24.04
strategy:
+6
View File
@@ -38,6 +38,12 @@ jobs:
"pre-version": "${PRE_VERSION}"
}
EOF
env:
VERSION: "${{ inputs.version }}"
PRE_VERSION: "${{ inputs.pre-version }}"
if: ${{ github.event_name == 'workflow_dispatch' }}
name: Add and parse .tagpr.json
- run: |
# check if .tagpr.json exists
if [ ! -f .tagpr.json ]; then
echo "No .tagpr.json file found."
+13
View File
@@ -1,6 +1,18 @@
name: Build Webhooks image
on:
workflow_call:
inputs:
push_image:
description: "Push image"
required: false
type: boolean
default: false
push_image_tag:
description: "Push image tag"
default: "latest"
required: false
type: string
workflow_dispatch:
inputs:
push_image:
@@ -50,6 +62,7 @@ jobs:
run: bash ./scripts/resolve-modules.sh ./webhooks
golangci-lint:
if: ${{ github.event_name }} == 'push' || ${{ github.event_name }} == 'pull_request'
needs: [ resolve-modules ]
runs-on: ubuntu-24.04
strategy: