Skip to content

Commit 4b58b9e

Browse files
authored
feat(release): update release workflow to trigger on tag pushes (#6093)
1 parent def18f0 commit 4b58b9e

File tree

8 files changed

+114
-83
lines changed

8 files changed

+114
-83
lines changed

.github/workflows/cloud-release.yml

Lines changed: 33 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
11
name: Release Cloud
22

33
on:
4+
workflow_call:
5+
inputs:
6+
tag:
7+
description: "Tag for manual release"
8+
required: false
9+
default: ""
10+
type: string
11+
build_offline_tar_only:
12+
description: "Build offline tar only"
13+
required: false
14+
default: false
15+
type: boolean
416
workflow_dispatch:
517
inputs:
618
tag:
@@ -27,77 +39,33 @@ permissions:
2739
jobs:
2840
release-controllers:
2941
if: ${{ inputs.build_offline_tar_only == false }}
30-
runs-on: ubuntu-24.04
31-
steps:
32-
- name: Trigger Cloud Controller Release Workflow(only when tagged)
33-
uses: actions/github-script@v6
34-
with:
35-
script: |
36-
github.rest.actions.createWorkflowDispatch({
37-
owner: context.repo.owner,
38-
repo: context.repo.repo,
39-
workflow_id: 'controllers.yml',
40-
ref: "refs/tags/${{ github.ref_name }}",
41-
inputs: {
42-
push_image_tag: "${{ github.ref_name }}",
43-
push_image: true
44-
}
45-
})
42+
uses: ./.github/workflows/controllers.yml
43+
with:
44+
push_image: true
45+
push_image_tag: ${{ inputs.tag }}
46+
secrets: inherit
4647
release-frontends:
4748
if: ${{ inputs.build_offline_tar_only == false }}
48-
runs-on: ubuntu-24.04
49-
steps:
50-
- name: Trigger Cloud Frontends Release Workflow(only when tagged)
51-
uses: actions/github-script@v6
52-
with:
53-
script: |
54-
github.rest.actions.createWorkflowDispatch({
55-
owner: context.repo.owner,
56-
repo: context.repo.repo,
57-
workflow_id: 'frontends.yml',
58-
ref: "refs/tags/${{ github.ref_name }}",
59-
inputs: {
60-
push_image_tag: "${{ github.ref_name }}",
61-
push_image: true
62-
}
63-
})
64-
49+
uses: ./.github/workflows/frontends.yml
50+
with:
51+
push_image: true
52+
push_image_tag: ${{ inputs.tag }}
53+
secrets: inherit
6554
release-service:
6655
if: ${{ inputs.build_offline_tar_only == false }}
67-
runs-on: ubuntu-24.04
68-
steps:
69-
- name: Trigger Cloud Services Release Workflow(only when tagged)
70-
uses: actions/github-script@v6
71-
with:
72-
script: |
73-
github.rest.actions.createWorkflowDispatch({
74-
owner: context.repo.owner,
75-
repo: context.repo.repo,
76-
workflow_id: 'services.yml',
77-
ref: "refs/tags/${{ github.ref_name }}",
78-
inputs: {
79-
push_image_tag: "${{ github.ref_name }}",
80-
push_image: true
81-
}
82-
})
56+
uses: ./.github/workflows/services.yml
57+
with:
58+
push_image: true
59+
push_image_tag: ${{ inputs.tag }}
60+
secrets: inherit
61+
8362
release-webhook:
8463
if: ${{ inputs.build_offline_tar_only == false }}
85-
runs-on: ubuntu-24.04
86-
steps:
87-
- name: Trigger Cloud Services Release Workflow(only when tagged)
88-
uses: actions/github-script@v6
89-
with:
90-
script: |
91-
github.rest.actions.createWorkflowDispatch({
92-
owner: context.repo.owner,
93-
repo: context.repo.repo,
94-
workflow_id: 'webhooks.yml',
95-
ref: "refs/tags/${{ github.ref_name }}",
96-
inputs: {
97-
push_image_tag: "${{ github.ref_name }}",
98-
push_image: true
99-
}
100-
})
64+
uses: ./.github/workflows/webhooks.yml
65+
with:
66+
push_image: true
67+
push_image_tag: ${{ inputs.tag }}
68+
secrets: inherit
10169
release-cloud:
10270
if: ${{ inputs.build_offline_tar_only == false }}
10371
needs:

.github/workflows/cloud.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,22 @@ jobs:
6666
if: ${{ (github.event_name == 'release') ||(github.event_name == 'push') || (inputs.push_image == true) }}
6767
runs-on: ubuntu-24.04
6868
steps:
69+
- name: Free Disk Space (Ubuntu)
70+
uses: BRAINSia/free-disk-space@v2
71+
with:
72+
# this might remove tools that are actually needed,
73+
# if set to "true" but frees about 6 GB
74+
tool-cache: false
75+
76+
# all of these default to true, but feel free to set to
77+
# "false" if necessary for your workflow
78+
mandb: true
79+
android: true
80+
dotnet: true
81+
haskell: true
82+
large-packages: true
83+
docker-images: true
84+
swap-storage: true
6985
- name: Checkout
7086
uses: actions/checkout@v4
7187
with:

.github/workflows/controllers.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
11
name: Build Controllers image
22

33
on:
4+
workflow_call:
5+
inputs:
6+
push_image:
7+
description: "Push image"
8+
required: false
9+
type: boolean
10+
default: false
11+
push_image_tag:
12+
description: "Push image tag"
13+
default: "latest"
14+
required: false
15+
type: string
416
workflow_dispatch:
517
inputs:
618
push_image:

.github/workflows/frontends.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
11
name: Build Frontends Image
22

33
on:
4+
workflow_call:
5+
inputs:
6+
push_image:
7+
description: "Push image"
8+
required: false
9+
type: boolean
10+
default: false
11+
push_image_tag:
12+
description: "Push image tag"
13+
default: "latest"
14+
required: false
15+
type: string
416
workflow_dispatch:
517
inputs:
618
push_image:

.github/workflows/release.yml

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ env:
77

88
on:
99
workflow_dispatch:
10+
push:
11+
tags:
12+
- "*"
1013

1114
jobs:
1215
releaser:
@@ -47,27 +50,15 @@ jobs:
4750
USERNAME: ${{ github.repository_owner }}
4851
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4952
FURY_TOKEN: ${{ secrets.FURY_TOKEN }}
50-
5153
cloud-release:
52-
runs-on: ubuntu-24.04
54+
uses: ./.github/workflows/cloud-release.yml
5355
needs:
5456
- releaser
5557
permissions:
56-
contents: read
58+
contents: write
5759
packages: write
5860
actions: write
59-
steps:
60-
- name: Trigger Cloud Release Workflow(only when tagged)
61-
uses: actions/github-script@v6
62-
with:
63-
script: |
64-
github.rest.actions.createWorkflowDispatch({
65-
owner: context.repo.owner,
66-
repo: context.repo.repo,
67-
workflow_id: 'cloud-release.yml',
68-
ref: "refs/tags/${{ github.ref_name }}",
69-
inputs: {
70-
tag: "${{ github.ref_name }}",
71-
build_offline_tar_only: false
72-
}
73-
})
61+
secrets: inherit
62+
with:
63+
tag: ${{ github.ref_name }}
64+
build_offline_tar_only: false

.github/workflows/services.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
11
name: Build Services image
22

33
on:
4+
workflow_call:
5+
inputs:
6+
push_image:
7+
description: "Push image"
8+
required: false
9+
type: boolean
10+
default: false
11+
push_image_tag:
12+
description: "Push image tag"
13+
default: "latest"
14+
required: false
15+
type: string
416
workflow_dispatch:
517
inputs:
618
push_image:
@@ -49,6 +61,7 @@ jobs:
4961
run: bash scripts/resolve-modules.sh ./service
5062

5163
golangci-lint:
64+
if: ${{ github.event_name }} == 'push' || ${{ github.event_name }} == 'pull_request'
5265
needs: [resolve-modules]
5366
runs-on: ubuntu-24.04
5467
strategy:

.github/workflows/tagpr.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,12 @@ jobs:
3838
"pre-version": "${PRE_VERSION}"
3939
}
4040
EOF
41+
env:
42+
VERSION: "${{ inputs.version }}"
43+
PRE_VERSION: "${{ inputs.pre-version }}"
44+
if: ${{ github.event_name == 'workflow_dispatch' }}
45+
name: Add and parse .tagpr.json
46+
- run: |
4147
# check if .tagpr.json exists
4248
if [ ! -f .tagpr.json ]; then
4349
echo "No .tagpr.json file found."

.github/workflows/webhooks.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
11
name: Build Webhooks image
22

33
on:
4+
workflow_call:
5+
inputs:
6+
push_image:
7+
description: "Push image"
8+
required: false
9+
type: boolean
10+
default: false
11+
push_image_tag:
12+
description: "Push image tag"
13+
default: "latest"
14+
required: false
15+
type: string
416
workflow_dispatch:
517
inputs:
618
push_image:
@@ -50,6 +62,7 @@ jobs:
5062
run: bash ./scripts/resolve-modules.sh ./webhooks
5163

5264
golangci-lint:
65+
if: ${{ github.event_name }} == 'push' || ${{ github.event_name }} == 'pull_request'
5366
needs: [ resolve-modules ]
5467
runs-on: ubuntu-24.04
5568
strategy:

0 commit comments

Comments
 (0)