Skip to content

Commit 486882f

Browse files
committed
refactor: move versioning script out
1 parent 3823da0 commit 486882f

File tree

6 files changed

+33
-50
lines changed

6 files changed

+33
-50
lines changed

.version

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.3.833
1+
0.3.835

README.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ See user documentation at https://templ.guide
2323
Build a local version.
2424

2525
```sh
26-
go run ./get-version > .version
26+
version set --template="0.3.%d"
2727
cd cmd/templ
2828
go build
2929
```
@@ -39,7 +39,7 @@ rm -f ~/bin/templ
3939
# Clear LSP logs.
4040
rm -f cmd/templ/lspcmd/*.txt
4141
# Update version.
42-
go run ./get-version > .version
42+
version set --template="0.3.%d"
4343
# Install to $GOPATH/bin or $HOME/go/bin
4444
cd cmd/templ && go install
4545
```
@@ -65,7 +65,7 @@ go run ./cmd/templ generate -include-version=false
6565
Run Go tests.
6666

6767
```sh
68-
go run ./get-version > .version
68+
version set --template="0.3.%d"
6969
go run ./cmd/templ generate -include-version=false
7070
go test ./...
7171
```
@@ -75,7 +75,7 @@ go test ./...
7575
Run Go tests.
7676

7777
```sh
78-
go run ./get-version > .version
78+
version set --template="0.3.%d"
7979
go run ./cmd/templ generate -include-version=false
8080
go test ./... -short
8181
```
@@ -159,7 +159,7 @@ git diff --exit-code
159159
Push a semantic version number to GitHub to trigger the release process.
160160

161161
```sh
162-
./push-tag.sh
162+
version push --template="0.3.%d" --prefix="v"
163163
```
164164

165165
### docs-run

flake.lock

+21
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

+6-1
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,17 @@
88
url = "github:hercules-ci/gitignore.nix";
99
inputs.nixpkgs.follows = "nixpkgs";
1010
};
11+
version = {
12+
url = "github:a-h/version";
13+
inputs.nixpkgs.follows = "nixpkgs";
14+
};
1115
xc = {
1216
url = "github:joerdav/xc";
1317
inputs.nixpkgs.follows = "nixpkgs";
1418
};
1519
};
1620

17-
outputs = { self, nixpkgs, nixpkgs-unstable, gitignore, xc }:
21+
outputs = { self, nixpkgs, nixpkgs-unstable, gitignore, version, xc }:
1822
let
1923
allSystems = [
2024
"x86_64-linux" # 64-bit Intel/AMD Linux
@@ -63,6 +67,7 @@
6367
pkgs.gotestsum
6468
pkgs.ko # Used to build Docker images.
6569
pkgs.nodejs # Used to build templ-docs.
70+
version.packages.${system}.default # Used to apply version numbers to the repo.
6671
xc.packages.${system}.xc
6772
];
6873
});

get-version/main.go

-29
This file was deleted.

push-tag.sh

-14
This file was deleted.

0 commit comments

Comments
 (0)