-
Notifications
You must be signed in to change notification settings - Fork 2
72 lines (60 loc) · 2.05 KB
/
Copy pathbuild.yml
File metadata and controls
72 lines (60 loc) · 2.05 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
name: Build
on:
push:
branches: [main]
tags:
- "v*.*.*"
pull_request:
permissions:
contents: read
pull-requests: write
jobs:
test:
name: Test & Validate
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Validate version matches tag
if: startsWith(github.ref, 'refs/tags/v')
run: |
TAG_VERSION="${GITHUB_REF#refs/tags/v}"
VSCODE_VERSION=$(jq -r .version extensions/vscode/package.json)
ZED_VERSION=$(grep '^version = ' extensions/zed/extension.toml | cut -d'"' -f2)
NPM_VERSION=$(jq -r .version npm/package.json)
echo "Checking version consistency:"
echo " Git tag: v$TAG_VERSION"
echo " VSCode: $VSCODE_VERSION"
echo " Zed: $ZED_VERSION"
echo " npm: $NPM_VERSION"
echo ""
if [ "$TAG_VERSION" != "$VSCODE_VERSION" ] || [ "$TAG_VERSION" != "$ZED_VERSION" ] || [ "$TAG_VERSION" != "$NPM_VERSION" ]; then
echo "❌ ERROR: Version mismatch detected!"
echo ""
echo "The git tag version does not match the extension versions."
echo "This usually means you forgot to run the version script before creating the release."
echo ""
echo "To fix this:"
echo " 1. Delete this release and tag"
echo " 2. Run: make release v$TAG_VERSION"
echo ""
exit 1
fi
echo "✓ Version check passed"
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Lint
run: make lint
- name: Test with coverage
run: make test-coverage
- uses: codecov/codecov-action@v5
with:
files: coverage.out
token: ${{ secrets.CODECOV_PAT }}
fail_ci_if_error: true
build:
needs: test
uses: bennypowers/go-release-workflows/.github/workflows/build-binaries.yml@main
with:
binary-name: asimonim
# No release-tag = artifacts only + PR comment with build status