fix(ci-cd): Improve CI:CD

This commit is contained in:
Myzel394 2024-10-16 21:33:40 +02:00
parent 6791e391e8
commit d7cbc9f454
No known key found for this signature in database
GPG Key ID: ED20A1D1D423AF3F
4 changed files with 16 additions and 4 deletions

View File

@ -12,6 +12,15 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
- name: Check version in code matches flake version
shell: bash
run: |
if ! [ $(grep '// CI:CD-VERSION$' server/root-handler/handler.go | cut -d'"' -f 2) = $(nix eval --file flake.nix inputs.version | cut -d '"' -f 2) ];
then
echo "Version mismatch"
exit 1
fi
- uses: cachix/install-nix-action@v27
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}

View File

@ -9,9 +9,10 @@
inputs.utils.follows = "utils";
};
utils.url = "github:numtide/flake-utils";
version = "0.1.0";
};
outputs = { self, nixpkgs, utils, gomod2nix }:
outputs = { self, nixpkgs, utils, gomod2nix, version }:
utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
@ -30,7 +31,7 @@
server = pkgs.buildGoModule {
nativeBuildInputs = inputs;
pname = "github.com/Myzel394/config-lsp";
version = "v0.0.1";
version = version;
src = ./server;
vendorHash = "sha256-s+sjOVvqU20+mbEFKg+RCD+dhScqSatk9eseX2IioPI";
checkPhase = ''

View File

@ -9,7 +9,9 @@ import (
const lsName = "config-lsp"
var version string = "0.0.1"
// The comment below at the end of the line is required for the CI:CD to work.
// Do not remove it
var version = "0.1.0" // CI:CD-VERSION
var lspHandler protocol.Handler

View File

@ -3,7 +3,7 @@
"description": "A language server example using language services to support embedded languages",
"author": "Microsoft Corporation",
"license": "MIT",
"version": "1.0.0",
"version": "0.1.0",
"repository": {
"type": "git",
"url": "https://github.com/Microsoft/vscode-extension-samples"