Skip to content

Commit 4a082c6

Browse files
Add preflight checks, Wally publish, and draft release flow
1 parent 0e8e249 commit 4a082c6

File tree

2 files changed

+53
-8
lines changed

2 files changed

+53
-8
lines changed

.github/workflows/release.yml

Lines changed: 51 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,32 @@ on:
55
tags: ["v*"]
66

77
jobs:
8+
preflight:
9+
name: Preflight Checks
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v6
13+
14+
- name: Check wally.toml version matches tag
15+
run: |
16+
TAG="${{ github.ref_name }}"
17+
WALLY_VERSION="v$(grep -m1 '^version' wally.toml | sed 's/.*"\(.*\)".*/\1/')"
18+
if [ "$WALLY_VERSION" != "$TAG" ]; then
19+
echo "::error::wally.toml version ($WALLY_VERSION) does not match tag ($TAG). Update the version in wally.toml before releasing."
20+
exit 1
21+
fi
22+
23+
- name: Check CHANGELOG.md has entry for this version
24+
run: |
25+
TAG="${{ github.ref_name }}"
26+
if ! grep -q "^# $TAG" CHANGELOG.md; then
27+
echo "::error::No changelog entry found for $TAG in CHANGELOG.md. Add a '# $TAG' section before releasing."
28+
exit 1
29+
fi
30+
831
create-release:
932
name: Create Release
33+
needs: preflight
1034
runs-on: ubuntu-latest
1135
permissions:
1236
contents: write
@@ -34,13 +58,28 @@ jobs:
3458
exit 1
3559
fi
3660
61+
# Strip leading 'v' for wally version URL
62+
VERSION="${TAG#v}"
63+
WALLY_URL="https://wally.run/package/cameronpcampbell/typeforge?version=${VERSION}"
64+
65+
cat > /tmp/release_body.md << EOF
66+
# Changelog
67+
${CHANGELOG}
68+
69+
---
70+
71+
# Wally
72+
Install via [Wally](${WALLY_URL}):
73+
\`\`\`toml
74+
typeforge = "cameronpcampbell/typeforge@${VERSION}"
75+
\`\`\`
76+
EOF
77+
3778
if gh release view "$TAG" > /dev/null 2>&1; then
38-
echo "Release $TAG already exists. Updating with changelog."
39-
printf '%s\n' "$CHANGELOG" > /tmp/release_body.md
40-
gh release edit "$TAG" --title "$TAG" --notes-file /tmp/release_body.md
79+
echo "Release $TAG already exists. Updating."
80+
gh release edit "$TAG" --draft --title "Typeforge $TAG" --notes-file /tmp/release_body.md
4181
else
42-
printf '%s\n' "$CHANGELOG" > /tmp/release_body.md
43-
gh release create "$TAG" --verify-tag --title "$TAG" --notes-file /tmp/release_body.md
82+
gh release create "$TAG" --draft --verify-tag --title "Typeforge $TAG" --notes-file /tmp/release_body.md
4483
fi
4584
4685
- name: Rokit Cache Restore
@@ -57,7 +96,8 @@ jobs:
5796
- name: Install Tools
5897
run: |
5998
export PATH="$HOME/.rokit/bin:$PATH"
60-
rokit install --trust-all
99+
rokit trust UpliftGames/wally
100+
rokit install
61101
62102
- name: Rokit Cache Save
63103
if: always()
@@ -75,3 +115,8 @@ jobs:
75115
"https://api.wally.run/" = "${{ secrets.WALLY_TOKEN }}"
76116
EOF
77117
wally publish
118+
119+
- name: Publish Release
120+
env:
121+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
122+
run: gh release edit "${{ github.ref_name }}" --draft=false

wally.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
[package]
22
name = "cameronpcampbell/typeforge"
33
description = "A Type Function utility library."
4-
version = "3.0.0"
4+
version = "3.0.1"
55
registry = "https://github.com/UpliftGames/wally-index"
66
realm = "shared"
77
license = "MIT"
88
authors=[ "Cameron Campbell" ]
99
exclude=[ "**", "**/*.test.luau", "**/*.bench.luau" ]
10-
include=[ "src", "src/**", "default.project.json", "wally.toml", "wally.lock", "LICENSE.md", "README.md" ]
10+
include=[ "src", "src/**", "default.project.json", "wally.toml", "wally.lock", "LICENSE.md", "README.md" ]

0 commit comments

Comments
 (0)