Skip to content

Commit 65092bf

Browse files
committed
[workflow] Auto release on tag push?
1 parent 7310d37 commit 65092bf

2 files changed

Lines changed: 12 additions & 4 deletions

File tree

.github/workflows/release.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
name: release
22
on:
33
workflow_dispatch:
4+
push:
5+
tags:
6+
- "v*.*.*"
7+
branches-ignore:
8+
- "**"
49

510
permissions:
611
actions: read
@@ -16,10 +21,10 @@ jobs:
1621
with:
1722
submodules: true
1823

19-
- name: Check for successful CI run
24+
- name: Wait for successful CI run
2025
env:
2126
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
22-
run: python3 scripts/release.py check-ci ${{ github.sha }}
27+
run: python3 scripts/release.py wait-ci ${{ github.sha }}
2328

2429
- name: Install cargo-about
2530
run: cargo install --locked cargo-about

scripts/release.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,12 @@ def check_ci(args: argparse.Namespace):
157157

158158

159159
def wait_ci(args: argparse.Namespace):
160-
max_minutes = 10
160+
max_minutes = 15
161161
while True:
162+
# Sleep first to try to prevent racing against the CI workflow being
163+
# queued.
164+
time.sleep(60)
165+
162166
runs = query_ci_runs(args.hash)
163167
success_id = successful_run_id(runs)
164168
if success_id is not None:
@@ -185,7 +189,6 @@ def wait_ci(args: argparse.Namespace):
185189
f"Waiting on CI run https://github.com/mshroyer/coursepointer/actions/runs/{pending_id} for commit {args.hash}"
186190
)
187191
max_minutes -= 1
188-
time.sleep(60)
189192

190193

191194
def create(args: argparse.Namespace):

0 commit comments

Comments
 (0)