Skip to content

Commit 24cc246

Browse files
committed
release: Revamp the entire release system
1 parent bd2f615 commit 24cc246

4 files changed

Lines changed: 463 additions & 140 deletions

File tree

.github/workflows/release.yaml

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ jobs:
2525
- name: Checkout code
2626
uses: actions/checkout@v4
2727
with:
28+
ref: ${{ inputs.version }}
2829
fetch-depth: 0
2930

3031
- name: Check tag exists
@@ -102,16 +103,21 @@ jobs:
102103
env:
103104
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
104105
run: |
105-
gh release create "$VERSION" \
106-
--title "YAMLScript $VERSION" \
107-
--notes-file release-notes.txt \
108-
--draft=false \
109-
--prerelease=false
106+
if gh release view "$VERSION" >/dev/null 2>&1; then
107+
echo "Release $VERSION already exists, skipping creation"
108+
else
109+
gh release create "$VERSION" \
110+
--title "$VERSION" \
111+
--notes-file release-notes.txt \
112+
--draft=false \
113+
--prerelease=false
114+
fi
110115
111116
build-linux-x64:
112117
name: Build Linux x64
113118
needs: create-release
114-
runs-on: ubuntu-20.04
119+
runs-on: ubuntu-latest
120+
container: ubuntu:20.04
115121
steps:
116122
- name: Checkout code
117123
uses: actions/checkout@v4
@@ -128,8 +134,8 @@ jobs:
128134

129135
- name: Install build dependencies
130136
run: |
131-
sudo apt-get update
132-
sudo apt-get install -y build-essential zlib1g-dev
137+
apt-get update
138+
apt-get install -y build-essential zlib1g-dev curl git
133139
134140
- name: Build and create release archives
135141
run: |

.version.ys

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ vo =: v-old.str/replace(/\./ '\\.')
2121
- regx:: "()${vp}()"
2222
file:
2323
- Meta
24-
- ReadMe.md
2524
- common/install.mk
2625
- common/release.md
2726
# Don't update common/vars.mk
@@ -34,8 +33,6 @@ vo =: v-old.str/replace(/\./ '\\.')
3433
- doc/install.md
3534
- doc/run-ys.md
3635
- doc/ys.md
37-
- go/ReadMe.md
38-
- go/doc/readme.md
3936
- go/yamlscript.go
4037
- java/Makefile
4138
- java/src/main/java/org/yamlscript/yamlscript/YAMLScript.java

Makefile

Lines changed: 81 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ include common/base.mk
22
include $(COMMON)/java.mk
33
include $(COMMON)/docker.mk
44

5+
include $(MAKES)/gh.mk
56
include $(SHELL-LANGS:%=$(MAKES)/%.mk)
67
include $(MAKES)/shell.mk
78

@@ -208,9 +209,9 @@ docker-build := YS_BUILD_IN_DOCKER=1
208209
endif
209210
endif
210211

211-
_release-yamlscript: $(YS)
212+
_release-yamlscript: $(YS) $(GH)
212213
($(TIME) $(docker-build) \
213-
$< $(ROOT)/util/release-yamlscript $o $n $s) 2>&1 | \
214+
ys $(ROOT)/util/release-yamlscript release $o $n $s) 2>&1 | \
214215
tee -a $(RELEASE-LOG)
215216

216217
release-assets: $(RELEASE-ASSETS)
@@ -222,6 +223,84 @@ release-build-ys: $(YS-RELEASE)
222223

223224
release-build-libys: $(LYS-RELEASE)
224225

226+
#------------------------------------------------------------------------------
227+
# Interactive Release Workflow - Individual Step Targets
228+
#------------------------------------------------------------------------------
229+
230+
# Show all release steps
231+
release-list:
232+
$(YS) $(ROOT)/util/release-yamlscript list
233+
234+
# Step 1: Sanity checks
235+
release-sanity-check:
236+
ifndef o
237+
$(error 'make release-sanity-check' requires o=OLD_VERSION n=NEW_VERSION)
238+
endif
239+
ifndef n
240+
$(error 'make release-sanity-check' requires o=OLD_VERSION n=NEW_VERSION)
241+
endif
242+
$(YS) $(ROOT)/util/release-yamlscript sanity-check $(o) $(n)
243+
244+
# Step 2: Version bump
245+
release-version-bump:
246+
$(YS) $(ROOT)/util/release-yamlscript version-bump
247+
248+
# Step 3: Changelog
249+
release-changelog:
250+
ifndef o
251+
$(error 'make release-changelog' requires o=OLD_VERSION n=NEW_VERSION)
252+
endif
253+
ifndef n
254+
$(error 'make release-changelog' requires o=OLD_VERSION n=NEW_VERSION)
255+
endif
256+
$(YS) $(ROOT)/util/release-yamlscript changelog $(o) $(n)
257+
258+
# Step 4: Test (optional)
259+
release-test:
260+
$(YS) $(ROOT)/util/release-yamlscript test
261+
262+
# Step 5: Binding changelogs
263+
release-binding-changelogs:
264+
$(YS) $(ROOT)/util/release-yamlscript binding-changelogs
265+
266+
# Step 6: Commit
267+
release-commit:
268+
ifndef n
269+
$(error 'make release-commit' requires n=NEW_VERSION)
270+
endif
271+
$(YS) $(ROOT)/util/release-yamlscript commit $(n)
272+
273+
# Step 7: Tag
274+
release-tag:
275+
ifndef n
276+
$(error 'make release-tag' requires n=NEW_VERSION)
277+
endif
278+
$(YS) $(ROOT)/util/release-yamlscript tag $(n)
279+
280+
# Step 8: Push
281+
release-push:
282+
ifndef n
283+
$(error 'make release-push' requires n=NEW_VERSION)
284+
endif
285+
$(YS) $(ROOT)/util/release-yamlscript push $(n)
286+
287+
# Step 9: Trigger GitHub Actions
288+
release-build-github:
289+
ifndef n
290+
$(error 'make release-build-github' requires n=NEW_VERSION)
291+
endif
292+
$(YS) $(ROOT)/util/release-yamlscript build-github $(n)
293+
294+
# Step 10: Release bindings
295+
release-bindings:
296+
$(YS) $(ROOT)/util/release-yamlscript bindings
297+
298+
# Step 11: Publish website
299+
release-website:
300+
$(YS) $(ROOT)/util/release-yamlscript website
301+
302+
#------------------------------------------------------------------------------
303+
225304
jars: $(JAR-ASSETS)
226305

227306
$(YS-RELEASE): $(RELEASE-YS-NAME)

0 commit comments

Comments
 (0)