feat: Use goreleaser

This commit is contained in:
Myzel394 2024-10-17 10:47:30 +02:00
parent 45af7bee3d
commit fc792b3274
No known key found for this signature in database
GPG Key ID: ED20A1D1D423AF3F
3 changed files with 26 additions and 21 deletions

View File

@ -14,6 +14,8 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Check git version matches flake version
shell: bash
@ -40,25 +42,17 @@ jobs:
- name: Check Flake
run: nix flake check
- name: Build release
run: nix build
- name: Copy config-lsp
run: cp result/bin/config-lsp .
- name: Build VS code extension
run: ./vs-code-extension/build-extension.sh
- name: Zip folder
shell: bash
run: cd vs-code-extension/out/ && zip -r vs-code-extension.zip . && cd ../..
- name: Upload config-lsp
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
- name: Set up Go
uses: actions/setup-go@v5
with:
files: |
./config-lsp
./vs-code-extension/out/vs-code-extension.zip
go-version: stable
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: "~> v2"
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GH_CONFIGLSP_TOKEN }}

2
.gitignore vendored
View File

@ -29,3 +29,5 @@ config-lsp
result
bin
debug.log
dist/

View File

@ -12,7 +12,16 @@
};
outputs = { self, nixpkgs, utils, gomod2nix }:
utils.lib.eachDefaultSystem (system:
utils.lib.eachSystem [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
"x86_64-windows"
"aarch64-windows"
] (system:
let
version = "0.1.0"; # CI:CD-VERSION
pkgs = import nixpkgs {