-
Notifications
You must be signed in to change notification settings - Fork 0
160 lines (126 loc) · 4.82 KB
/
release.yml
File metadata and controls
160 lines (126 loc) · 4.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
name: Release
on:
push:
tags:
- "v*"
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Full history for changelog generation
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- uses: actions/setup-node@v4
with:
node-version: "20"
- name: Extract version from tag
id: version
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
- name: Update package.json version
run: |
cd packages/vscode-extension
npm version ${{ steps.version.outputs.VERSION }} --no-git-tag-version --allow-same-version
- name: Build all outputs
run: python tools/build.py
- name: Sync changelog to site
run: python tools/sync-changelog.py
- name: Build VS Code extension
run: |
cd packages/vscode-extension
npm install
npx @vscode/vsce package --no-dependencies
mv *.vsix ../../
- name: Package dist
run: |
VERSION=${{ github.ref_name }}
tar -czf human-plus-plus-${VERSION}-dist.tar.gz dist/
zip -r human-plus-plus-${VERSION}-dist.zip dist/
- name: Generate changelog
id: changelog
run: |
# Get previous tag
PREV_TAG=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || echo "")
if [ -n "$PREV_TAG" ]; then
echo "Changes since $PREV_TAG:"
CHANGES=$(git log ${PREV_TAG}..HEAD --pretty=format:"- %s" --no-merges)
else
echo "First release"
CHANGES=$(git log --pretty=format:"- %s" --no-merges -20)
fi
# Write changelog to file (handles multiline)
echo "$CHANGES" > changelog-items.txt
- name: Generate release notes
run: |
VERSION=${{ github.ref_name }}
CHANGES=$(cat changelog-items.txt)
cat << EOF > release-notes.md
## Human++ ${VERSION}
A Base24 color scheme for the post-artisanal coding era.
### What's Changed
${CHANGES}
### Install
**VS Code / Cursor:**
Search "Human++" in extensions, or install from CLI:
\`\`\`bash
code --install-extension fielding.human-plus-plus
\`\`\`
Or download the \`.vsix\` below and install manually.
**Other Apps (with tinty):**
\`\`\`bash
tinty apply base24-human-plus-plus
\`\`\`
**Manual:** Download and extract the archive, copy configs to your app's config directory.
### Included Configs
- \`ghostty/config\` - Ghostty terminal
- \`sketchybar/colors.sh\` - Sketchybar
- \`borders/bordersrc\` - JankyBorders
- \`skhd/modes.sh\` - skhd mode indicators
- \`base24/\` - Shell theme and tinty registry
### Links
- [VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=fielding.human-plus-plus)
- [Open VSX (Cursor)](https://open-vsx.org/extension/fielding/human-plus-plus)
- [Documentation](https://github.com/fielding/human-plus-plus)
- [Live Preview](https://fielding.github.io/human-plus-plus/)
EOF
- name: Publish to VS Code Marketplace
continue-on-error: true
env:
VSCE_PAT: ${{ secrets.VSCE_PAT }}
run: |
if [ -n "$VSCE_PAT" ]; then
cd packages/vscode-extension
npx @vscode/vsce publish --no-dependencies -p "$VSCE_PAT"
else
echo "VSCE_PAT not set, skipping VS Code Marketplace publish"
fi
- name: Publish to Open VSX
continue-on-error: true
env:
OVSX_PAT: ${{ secrets.OVSX_PAT }}
run: |
if [ -n "$OVSX_PAT" ]; then
cd packages/vscode-extension
npx ovsx publish --no-dependencies -p "$OVSX_PAT"
else
echo "OVSX_PAT not set, skipping Open VSX publish"
fi
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
body_path: release-notes.md
files: |
human-plus-plus-*.vsix
human-plus-plus-${{ github.ref_name }}-dist.tar.gz
human-plus-plus-${{ github.ref_name }}-dist.zip
- name: Commit updated files
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add templates/site/index.html.tmpl packages/vscode-extension/package.json
git diff --staged --quiet || git commit -m "chore: sync changelog and version for ${{ github.ref_name }}"
git push origin HEAD:main || echo "Nothing to push"