GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — ci(release): master-triggered svu->tag->goreleaser, serialized, no to… · ucloud/ucloud-cli@db904a7

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • .github/workflows
    • release.yml
  • .svu.yaml
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎.github/workflows/release.yml‎

Copy file name to clipboard
+70-17Lines changed: 70 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,83 @@
1+
# Merge-to-release automation
2+
#
3+
# Flow:
4+
# 1. A PR merges to master (or workflow_dispatch for the first guarded run).
5+
# 2. svu inspects the commit log since the last vX.Y.Z tag and computes
6+
# the next semver based on conventional commits (feat→minor, fix→patch,
7+
# breaking→major).
8+
# 3. If the computed next version differs from current (i.e. there are
9+
# releasable commits), the job tags HEAD with the new version and pushes
10+
# the tag — all in the SAME job that runs goreleaser.
11+
# This avoids the "default GITHUB_TOKEN-pushed tag doesn't trigger a
12+
# downstream workflow" trap: tag + release happen in one atomic job.
13+
# 4. goreleaser builds the binaries and creates the GitHub Release.
14+
# 5. If there are no new feat/fix commits, the job exits early without
15+
# creating a release.
16+
#
17+
# First-launch guard:
18+
# The `environment: release` line below requires manual approval via
19+
# GitHub → Settings → Environments → release before any run proceeds.
20+
# Once the monorepo branch has landed on master and one release has been
21+
# verified, remove the `environment: release` line in a follow-up PR to
22+
# enable fully automatic releases.
23+
124
name: Release
225

326
on:
427
push:
5-
tags:
6-
- '*'
28+
branches: [master]
29+
workflow_dispatch: {} # manual trigger for the first guarded run
30+
31+
concurrency:
32+
group: release
33+
cancel-in-progress: false # never cancel an in-flight release
734

835
jobs:
936
release:
10-
if: contains(github.ref, 'refs/tags/')
1137
runs-on: ubuntu-latest
38+
# FIRST-LAUNCH GUARD: requires manual approval via GitHub Environment.
39+
# Remove this line after the first verified release.
40+
environment: release
41+
permissions:
42+
contents: write # push tags + create GitHub Releases
43+
1244
steps:
13-
- name: Checkout
14-
uses: actions/checkout@v3
45+
- uses: actions/checkout@v4
46+
with:
47+
fetch-depth: 0 # svu and goreleaser both need full tag history
1548

16-
- name: Set up go
17-
uses: actions/setup-go@v3
18-
with:
19-
go-version: 1.19.2
49+
- uses: actions/setup-go@v5
50+
with:
51+
go-version: '1.25'
2052

21-
- name: Build
22-
run: bash hack/github-release.sh
53+
- name: Install svu
54+
run: go install github.com/caarlos0/svu@latest
55+
env:
56+
GOPROXY: https://goproxy.cn,direct
2357

24-
- name: Create release
25-
uses: softprops/action-gh-release@v1
26-
with:
27-
token: ${{ secrets.RELEASE_GITHUB_TOKEN }}
28-
files: |
29-
out/*.zip
58+
- name: Compute next version & tag
59+
id: ver
60+
run: |
61+
NEXT="$("$(go env GOPATH)/bin/svu" next)"
62+
CURRENT="$("$(go env GOPATH)/bin/svu" current)"
63+
echo "next=$NEXT" >> "$GITHUB_OUTPUT"
64+
echo "current=$CURRENT" >> "$GITHUB_OUTPUT"
65+
if [ "$NEXT" != "$CURRENT" ]; then
66+
git config user.name "github-actions[bot]"
67+
git config user.email "github-actions[bot]@users.noreply.github.com"
68+
git tag "$NEXT"
69+
git push origin "$NEXT"
70+
echo "released=true" >> "$GITHUB_OUTPUT"
71+
else
72+
echo "No new feat/fix commits since $CURRENT — skipping release."
73+
echo "released=false" >> "$GITHUB_OUTPUT"
74+
fi
3075
76+
- uses: goreleaser/goreleaser-action@v6
77+
if: steps.ver.outputs.released == 'true'
78+
with:
79+
version: latest
80+
args: release --clean
81+
env:
82+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
83+
GOPROXY: https://goproxy.cn,direct
Collapse file

‎.svu.yaml‎

Copy file name to clipboard
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
tag:
2+
prefix: v

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.