Skip to content

Commit f8eec68

Browse files
authored
ci: fix release type for nightly cron (#17429)
1 parent f227b91 commit f8eec68

File tree

2 files changed

+16
-6
lines changed

2 files changed

+16
-6
lines changed

.github/scripts/bump_version.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ module.exports = async ({ github, context, core }) => {
77

88
const { TYPE, TAG } = process.env;
99

10+
if (!TYPE) {
11+
core.setOutput("type", "nightly");
12+
} else {
13+
core.setOutput("type", TYPE);
14+
}
15+
1016
const RE_TAG_STABLE = /^v(\d+)\.(\d+)\.(\d+)$/;
1117
const RE_TAG_NIGHTLY = /^v(\d+)\.(\d+)\.(\d+)-nightly$/;
1218
const RE_TAG_PATCH = /^v(\d+)\.(\d+)\.(\d+)-p(\d+)$/;

.github/workflows/release.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ jobs:
4040
outputs:
4141
version: ${{ steps.bump.outputs.tag }}
4242
sha: ${{ steps.bump.outputs.sha }}
43+
type: ${{ steps.bump.outputs.type }}
4344
steps:
4445
- name: Checkout
4546
uses: actions/checkout@v4
@@ -61,7 +62,7 @@ jobs:
6162
# which is not possible for github actions token
6263
GH_TOKEN: ${{ secrets.DATABEND_BOT_TOKEN }}
6364
run: |
64-
case "${{ inputs.type }}" in
65+
case "${{ steps.bump.outputs.type }}" in
6566
nightly)
6667
gh release create ${{ steps.bump.outputs.tag }} --target ${{ steps.bump.outputs.sha }} --generate-notes --notes-start-tag ${{ steps.bump.outputs.previous }} --prerelease --draft
6768
;;
@@ -71,12 +72,15 @@ jobs:
7172
patch)
7273
gh release create ${{ steps.bump.outputs.tag }} --target ${{ steps.bump.outputs.sha }} --generate-notes --notes-start-tag ${{ steps.bump.outputs.previous }} --prerelease --draft
7374
;;
75+
*)
76+
echo "Invalid release type: ${{ steps.bump.outputs.type }}"
77+
exit 1
7478
esac
7579
7680
changelog:
7781
runs-on: ubuntu-latest
78-
if: inputs.type == 'stable'
7982
needs: create_release
83+
if: needs.create_release.outputs.type == 'stable'
8084
steps:
8185
- name: Checkout Docs
8286
uses: actions/checkout@v4
@@ -287,7 +291,7 @@ jobs:
287291
REPO_DOCKERHUB: ${{ steps.login.outputs.dockerhub_repo }}
288292
REPO_ECR: ${{ steps.login.outputs.ecr_repo }}
289293
VERSION: ${{ needs.create_release.outputs.version }}
290-
TYPE: ${{ inputs.type }}
294+
TYPE: ${{ needs.create_release.outputs.type }}
291295
with:
292296
script: |
293297
const { VERSION, TYPE, REPO_DOCKERHUB, REPO_ECR } = process.env;
@@ -367,7 +371,7 @@ jobs:
367371
REPO_DOCKERHUB: ${{ steps.login.outputs.dockerhub_repo }}
368372
REPO_ECR: ${{ steps.login.outputs.ecr_repo }}
369373
VERSION: ${{ needs.create_release.outputs.version }}
370-
TYPE: ${{ inputs.type }}
374+
TYPE: ${{ needs.create_release.outputs.type }}
371375
with:
372376
script: |
373377
const { VERSION, TYPE, REPO_DOCKERHUB, REPO_ECR } = process.env;
@@ -414,7 +418,7 @@ jobs:
414418
packager: ${{ matrix.packager }}
415419

416420
# bindings_python:
417-
# if: inputs.type == 'stable'
421+
# if: needs.create_release.outputs.type == 'stable'
418422
# needs: create_release
419423
# uses: ./.github/workflows/bindings.python.yml
420424
# secrets: inherit
@@ -454,8 +458,8 @@ jobs:
454458
455459
deb:
456460
runs-on: ubuntu-latest
457-
if: inputs.type == 'stable'
458461
needs: [create_release, distribution]
462+
if: needs.create_release.outputs.type == 'stable'
459463
steps:
460464
- uses: actions/checkout@v4
461465
with:

0 commit comments

Comments
 (0)