mirror of
https://github.com/Myzel394/config-lsp.git
synced 2025-06-18 23:15:26 +02:00
fix(ci-cd): Fix ci:cd
This commit is contained in:
parent
6aceec2c06
commit
c42329093e
81
.github/workflows/release.yaml
vendored
81
.github/workflows/release.yaml
vendored
@ -60,7 +60,7 @@ jobs:
|
|||||||
|
|
||||||
build-extension:
|
build-extension:
|
||||||
name: Build extension for ${{ matrix.target }}
|
name: Build extension for ${{ matrix.target }}
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ubuntu-latest
|
||||||
needs:
|
needs:
|
||||||
# Wait for server to build so that we know the checks have passed
|
# Wait for server to build so that we know the checks have passed
|
||||||
- build-server
|
- build-server
|
||||||
@ -68,26 +68,26 @@ jobs:
|
|||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- target: x86_64-apple-darwin
|
- goos: linux
|
||||||
os: macos-latest
|
goarch: amd64
|
||||||
cross: false
|
vscode_target: linux-x64
|
||||||
- target: aarch64-apple-darwin
|
- goos: linux
|
||||||
os: macos-latest
|
goarch: arm64
|
||||||
cross: false
|
vscode_target: linux-arm64
|
||||||
|
|
||||||
- target: x86_64-unknown-linux-gnu
|
- goos: darwin
|
||||||
os: ubuntu-latest
|
goarch: amd64
|
||||||
cross: false
|
vscode_target: darwin-x64
|
||||||
- target: aarch64-unknown-linux-gnu
|
- goos: darwin
|
||||||
os: ubuntu-latest
|
goarch: arm64
|
||||||
cross: false
|
vscode_target: darwin-arm64
|
||||||
|
|
||||||
# - target: x86_64-pc-windows-msvc
|
- goos: windows
|
||||||
# os: windows-latest
|
goarch: amd64
|
||||||
# cross: false
|
vscode_target: win32-x64
|
||||||
# - target: aarch64-pc-windows-msvc
|
- goos: windows
|
||||||
# os: windows-latest
|
goarch: arm64
|
||||||
# cross: false
|
vscode_target: win32-arm64
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
@ -95,38 +95,39 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- uses: cachix/install-nix-action@v27
|
- name: Set up Go
|
||||||
|
uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
github_access_token: ${{ secrets.GITHUB_TOKEN }}
|
go-version: stable
|
||||||
|
|
||||||
- name: Check Flake
|
- name: Create bare extension
|
||||||
run: nix flake check
|
run: nix build .#"vs-code-extension-bare"
|
||||||
|
|
||||||
- name: Build extension
|
- name: Build extension
|
||||||
run: nix build .#"vs-code-extension"
|
run: cd server && GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go build -a -gcflags=all="-l -B" -ldflags="-s -w" -o config-lsp
|
||||||
|
|
||||||
- name: Rename extension
|
- name: Prepare folder
|
||||||
run: cp result/*.vsix $(basename result/*.vsix)-${{ matrix.target }}.vsix
|
run: cp -rL result dist && chmod -R 777 dist
|
||||||
|
|
||||||
|
- name: Move binary to extension
|
||||||
|
run: mv server/config-lsp dist/out/
|
||||||
|
|
||||||
|
- name: Shrink binary
|
||||||
|
if: ${{ matrix.goos == 'linux' }}
|
||||||
|
run: nix develop .#"shrink" --command bash -c "upx dist/out/config-lsp"
|
||||||
|
|
||||||
|
- name: Package extension
|
||||||
|
run: nix develop .#"vs-code-extension" --command bash -c "cd dist && vsce package --target ${{ matrix.vscode_target }}"
|
||||||
|
|
||||||
|
- name: Move vsix to root
|
||||||
|
run: mv dist/*.vsix .
|
||||||
|
|
||||||
- uses: softprops/action-gh-release@v2
|
- uses: softprops/action-gh-release@v2
|
||||||
with:
|
with:
|
||||||
files: '*.vsix'
|
files: '*.vsix'
|
||||||
|
|
||||||
- name: Target to vs code target
|
|
||||||
id: vscode_target
|
|
||||||
run: |
|
|
||||||
if [ "${{ matrix.target }}" = "x86_64-apple-darwin" ]; then
|
|
||||||
echo "target=darwin-x64" >> $GITHUB_OUTPUT
|
|
||||||
elif [ "${{ matrix.target }}" = "aarch64-apple-darwin" ]; then
|
|
||||||
echo "target=darwin-arm64" >> $GITHUB_OUTPUT
|
|
||||||
elif [ "${{ matrix.target }}" = "x86_64-unknown-linux-gnu" ]; then
|
|
||||||
echo "target=linux-x64" >> $GITHUB_OUTPUT
|
|
||||||
elif [ "${{ matrix.target }}" = "aarch64-unknown-linux-gnu" ]; then
|
|
||||||
echo "target=linux-arm64" >> $GITHUB_OUTPUT
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Upload extension to VS Code Marketplace
|
- name: Upload extension to VS Code Marketplace
|
||||||
run: nix develop .#"vs-code-extension" --command bash -c "vsce publish --target ${{ steps.vscode_target.outputs.target }} --packagePath *.vsix"
|
run: nix develop .#"vs-code-extension" --command bash -c "vsce publish --packagePath *.vsix"
|
||||||
env:
|
env:
|
||||||
VSCE_PAT: ${{ secrets.VSCE_TOKEN }}
|
VSCE_PAT: ${{ secrets.VSCE_TOKEN }}
|
||||||
|
|
||||||
|
30
flake.nix
30
flake.nix
@ -68,6 +68,36 @@
|
|||||||
in {
|
in {
|
||||||
packages = {
|
packages = {
|
||||||
default = server;
|
default = server;
|
||||||
|
"vs-code-extension-bare" = let
|
||||||
|
name = "config-lsp";
|
||||||
|
node-modules = pkgs.mkYarnPackage {
|
||||||
|
src = ./vs-code-extension;
|
||||||
|
name = name;
|
||||||
|
packageJSON = ./vs-code-extension/package.json;
|
||||||
|
yarnLock = ./vs-code-extension/yarn.lock;
|
||||||
|
yarnNix = ./vs-code-extension/yarn.nix;
|
||||||
|
|
||||||
|
buildPhase = ''
|
||||||
|
yarn --offline run compile:prod
|
||||||
|
'';
|
||||||
|
installPhase = ''
|
||||||
|
mkdir -p extension
|
||||||
|
|
||||||
|
# No idea why this is being created
|
||||||
|
rm deps/${name}/config-lsp
|
||||||
|
|
||||||
|
cp -rL deps/${name}/. extension
|
||||||
|
|
||||||
|
mkdir -p $out
|
||||||
|
cp -r extension/. $out
|
||||||
|
'';
|
||||||
|
distPhase = "true";
|
||||||
|
|
||||||
|
buildInputs = [
|
||||||
|
pkgs.vsce
|
||||||
|
];
|
||||||
|
};
|
||||||
|
in node-modules;
|
||||||
"vs-code-extension" = let
|
"vs-code-extension" = let
|
||||||
name = "config-lsp";
|
name = "config-lsp";
|
||||||
node-modules = pkgs.mkYarnPackage {
|
node-modules = pkgs.mkYarnPackage {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user