Skip to content

Commit

Permalink
Version only from git tags
Browse files Browse the repository at this point in the history
  • Loading branch information
nrontsis committed Nov 8, 2024
1 parent c894b03 commit 70c999f
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 5 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/build-extension.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,18 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- uses: astral-sh/setup-uv@v3

- name: Update Version Numbers
if: startsWith(github.ref, 'refs/tags/')
run: |
VERSION=$(echo ${{ github.ref }} | sed 's/refs\/tags\/v//')
if ! [[ $VERSION =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "Invalid version format: $VERSION. Expected format: X.Y.Z"
exit 1
fi
for file in client/package.json client/package-lock.json server/server.py; do
sed -i "s/0\.0\.0+dynamic-from-tags/$VERSION/" "$file"
done
- name: Install Dependencies
run: cd client && npm ci
Expand Down
2 changes: 1 addition & 1 deletion README_DEV.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
### Building and publishing via Github Actions
The extension is built as an artifact of Github Actions on every commit to `main`.
It's published on the VSCode marketplace at every tagged commit.
The version of the extension is hardcoded on `client/package.json`, `client/package-lock.json` and `server/server.py`.
The version of the extension is managed via git tags.
### Local development:
Use the devcontainer included or a GitHub Codespace and
* Compile the `client` by running `npm --prefix client run compile`.
Expand Down
4 changes: 2 additions & 2 deletions client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"type": "git",
"url": "https://github.com/kapicorp/kapitan-vscode-extension"
},
"version": "0.0.4",
"version": "0.0.0+dynamic-from-tags",
"engines": {
"vscode": "^1.94.0"
},
Expand Down
4 changes: 3 additions & 1 deletion server/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
from pygls.server import LanguageServer
from pygls.workspace.text_document import TextDocument

server = LanguageServer(name="kapitan-language-server", version="0.0.4")
server = LanguageServer(
name="kapitan-language-server", version="0.0.0+dynamic-from-tags"
)
INVENTORY_PATH = Path()
YAML_EXTENSION = ""

Expand Down

0 comments on commit 70c999f

Please sign in to comment.