-
Notifications
You must be signed in to change notification settings - Fork 4
69 lines (59 loc) · 2.1 KB
/
next-release.yaml
File metadata and controls
69 lines (59 loc) · 2.1 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
name: Next Release
on:
push:
branches: [next]
workflow_dispatch:
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive
- uses: actions/setup-go@v5
with:
go-version: stable
- name: Calculate version and create tag
id: version
run: |
# Get latest stable semver tag (v0.0.0 format, exclude -next tags)
LATEST_TAG=$(git tag --list 'v*' --sort=-v:refname | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' | head -1)
if [ -z "$LATEST_TAG" ]; then
LATEST_TAG="v0.0.0"
fi
SHORT_HASH=$(git rev-parse --short=8 HEAD)
VERSION="${LATEST_TAG}-next.${SHORT_HASH}"
echo "Latest stable tag: $LATEST_TAG"
echo "HEAD commit: $SHORT_HASH"
echo "Creating tag: $VERSION"
echo "version=${VERSION}" >> $GITHUB_OUTPUT
# Delete remote tag if it exists (in case of re-run)
git push origin ":refs/tags/${VERSION}" 2>/dev/null || true
git tag -f "$VERSION"
git push origin "$VERSION"
- name: Sync docs for embed
run: make sync-docs
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
version: "~> v2"
args: release --clean --config .goreleaser.next.yaml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GORELEASER_CURRENT_TAG: ${{ steps.version.outputs.version }}
- uses: ./.github/actions/setup-vscode-extension
- name: Package VS Code extension
run: pnpm package:extension
- name: Upload VS Code extension to release
run: |
VSIX_FILE=$(ls integrations/vscode/*.vsix 2>/dev/null | head -1)
if [ -z "$VSIX_FILE" ]; then
echo "Error: No .vsix file found. Did the build step succeed?"
exit 1
fi
gh release upload "${{ steps.version.outputs.version }}" "$VSIX_FILE" --clobber
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}