Skip to content

Commit 296359d

Browse files
committed
ci: replace semantic-release with svu
* remove separate bump-semver and create-release workflows * consolidate release process into single workflow triggered on main branch * replace semantic-release tooling with svu for semantic version calculation * combine version bumping and release creation into unified script
1 parent bfb1f99 commit 296359d

5 files changed

Lines changed: 30 additions & 57 deletions

File tree

.github/workflows/main.yml

Lines changed: 0 additions & 21 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ name: release
33
on:
44
workflow_dispatch:
55
push:
6-
tags:
7-
- "v*"
6+
branches: [main]
87

98
permissions:
109
contents: write
@@ -17,7 +16,7 @@ jobs:
1716
with:
1817
fetch-depth: 0
1918
- uses: DeterminateSystems/nix-installer-action@main
20-
- name: Create release
21-
run: nix run .#create-release
19+
- name: Release
20+
run: nix run .#release
2221
env:
2322
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

nix/scripts/bump-semver.nix

Lines changed: 0 additions & 18 deletions
This file was deleted.

nix/scripts/create-release.nix

Lines changed: 0 additions & 14 deletions
This file was deleted.

nix/scripts/release.nix

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
writeShellApplication,
3+
git,
4+
svu,
5+
goreleaser,
6+
}:
7+
8+
writeShellApplication {
9+
name = "release";
10+
runtimeInputs = [
11+
git
12+
svu
13+
goreleaser
14+
];
15+
text = ''
16+
NEXT_TAG=$(svu next)
17+
18+
if [ -n "$(git tag -l "$NEXT_TAG")" ]; then
19+
echo "Tag $NEXT_TAG already exists, skipping release"
20+
exit 0
21+
fi
22+
23+
git tag "$NEXT_TAG"
24+
git push --tags
25+
goreleaser release --clean
26+
'';
27+
}

0 commit comments

Comments
 (0)