Skip to content

Commit fe6cccb

Browse files
committed
Improve release process, add changelog
1 parent 7533472 commit fe6cccb

File tree

5 files changed

+113
-6
lines changed

5 files changed

+113
-6
lines changed

.github/workflows/release.yml

Lines changed: 98 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@ on:
66
- "v*"
77

88
jobs:
9-
verify-and-publish:
10-
name: Verify and publish to npm
9+
verify-version:
10+
name: Verify version matches tag
1111
runs-on: ubuntu-latest
12+
outputs:
13+
version: ${{ steps.cargo_version.outputs.cargo_version }}
1214
steps:
1315
- uses: actions/checkout@v4
1416

@@ -36,6 +38,56 @@ jobs:
3638
fi
3739
echo "Versions match: ${{ steps.cargo_version.outputs.cargo_version }}"
3840
41+
- name: Check Unreleased section is empty
42+
run: |
43+
# Extract content between [Unreleased] and the next version section
44+
UNRELEASED=$(awk '/^## \[Unreleased\]/{flag=1; next} /^## \[/{flag=0} flag' CHANGELOG.md | grep -v '^$' | wc -l)
45+
46+
if [ "$UNRELEASED" -gt 0 ]; then
47+
echo "ERROR: CHANGELOG.md has unreleased changes!"
48+
echo "Please move unreleased changes to the [${{ steps.cargo_version.outputs.cargo_version }}] section before releasing."
49+
exit 1
50+
fi
51+
52+
echo "Unreleased section is empty ✓"
53+
54+
build-cli:
55+
name: Build CLI binary (Linux)
56+
needs: verify-version
57+
runs-on: ubuntu-latest
58+
steps:
59+
- uses: actions/checkout@v4
60+
61+
- name: Install Rust
62+
uses: dtolnay/rust-toolchain@stable
63+
64+
- name: Setup Rust cache
65+
uses: Swatinem/rust-cache@v2
66+
67+
- name: Build CLI
68+
run: cargo build --release --bin quiv
69+
70+
- name: Create tarball
71+
run: |
72+
cd target/release
73+
tar czf quiv-${{ needs.verify-version.outputs.version }}-linux-x86_64.tar.gz quiv
74+
sha256sum quiv-${{ needs.verify-version.outputs.version }}-linux-x86_64.tar.gz > quiv-${{ needs.verify-version.outputs.version }}-linux-x86_64.tar.gz.sha256
75+
76+
- name: Upload binary artifact
77+
uses: actions/upload-artifact@v4
78+
with:
79+
name: linux-binary
80+
path: |
81+
target/release/quiv-${{ needs.verify-version.outputs.version }}-linux-x86_64.tar.gz
82+
target/release/quiv-${{ needs.verify-version.outputs.version }}-linux-x86_64.tar.gz.sha256
83+
84+
publish-npm:
85+
name: Publish to npm
86+
needs: verify-version
87+
runs-on: ubuntu-latest
88+
steps:
89+
- uses: actions/checkout@v4
90+
3991
- name: Install Rust
4092
uses: dtolnay/rust-toolchain@stable
4193
with:
@@ -48,7 +100,7 @@ jobs:
48100
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
49101

50102
- name: Build WASM
51-
run: cd quiver-web && ./build.sh
103+
run: ./quiver-web/build.sh
52104

53105
- name: Setup Node.js
54106
uses: actions/setup-node@v4
@@ -62,3 +114,46 @@ jobs:
62114
npm publish --access public
63115
env:
64116
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
117+
118+
create-release:
119+
name: Create GitHub release
120+
needs: [verify-version, build-cli, publish-npm]
121+
runs-on: ubuntu-latest
122+
permissions:
123+
contents: write
124+
steps:
125+
- uses: actions/checkout@v4
126+
127+
- name: Download binary artifacts
128+
uses: actions/download-artifact@v4
129+
with:
130+
name: linux-binary
131+
path: artifacts
132+
133+
- name: Extract changelog for this version
134+
id: changelog
135+
run: |
136+
VERSION="${{ needs.verify-version.outputs.version }}"
137+
138+
# Extract the section for this version from CHANGELOG.md
139+
awk "/^## \[$VERSION\]/{flag=1; next} /^## \[/{flag=0} flag" CHANGELOG.md > release_notes.md
140+
141+
# Append npm package link
142+
echo "" >> release_notes.md
143+
echo "---" >> release_notes.md
144+
echo "" >> release_notes.md
145+
echo "**npm package:** https://www.npmjs.com/package/quiver-web/v/$VERSION" >> release_notes.md
146+
147+
# Output for debugging
148+
echo "Release notes:"
149+
cat release_notes.md
150+
151+
- name: Create GitHub Release
152+
uses: softprops/action-gh-release@v2
153+
with:
154+
body_path: release_notes.md
155+
files: |
156+
artifacts/quiv-${{ needs.verify-version.outputs.version }}-linux-x86_64.tar.gz
157+
artifacts/quiv-${{ needs.verify-version.outputs.version }}-linux-x86_64.tar.gz.sha256
158+
draft: false
159+
prerelease: false

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Changelog
2+
3+
## [Unreleased]
4+
5+
## [0.1.0] - 2025-10-20
6+
7+
### Added
8+
9+
- Initial release.
10+
11+
[unreleased]: https://github.com/quiverlang/quiver/compare/v0.1.0...HEAD
12+
[0.1.0]: https://github.com/quiverlang/quiver/releases/tag/v0.1.0

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ See [docs/spec.md](docs/spec.md) for the complete language specification.
4848

4949
### Building from source
5050

51-
Quiver requires Rust 2024 edition or later. Clone the repository and build:
51+
Clone the repository and build:
5252

5353
```bash
5454
git clone https://github.com/joefreeman/quiver.git

quiver-cli/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ version.workspace = true
44
edition.workspace = true
55

66
[[bin]]
7-
name = "quiver"
7+
name = "quiv"
88
path = "src/main.rs"
99

1010
[dependencies]

quiver-cli/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ mod repl_cli;
1414
use repl_cli::ReplCli;
1515

1616
#[derive(Parser)]
17-
#[command(name = "quiver")]
17+
#[command(name = "quiv", version, about = "Quiver CLI")]
1818
struct Cli {
1919
#[command(subcommand)]
2020
command: Option<Commands>,

0 commit comments

Comments
 (0)