Skip to content

Commit

Permalink
add github actions for packaging
Browse files Browse the repository at this point in the history
  • Loading branch information
rtk0c committed Nov 14, 2024
1 parent 33e3255 commit 9b433a0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
22 changes: 11 additions & 11 deletions .github/workflows/go.yml → .github/workflows/vsix.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
# This workflow will build a golang project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go

name: Go
name: Package VSIX

on:
push:
Expand All @@ -22,25 +19,28 @@ jobs:

- name: Build
run: |
cd server
GOOS=linux GOARCH=amd64 go build -o linux/vls
GOOS=windows GOARCH=amd64 go build -o windows/vls.exe
GOOS=darwin GOARCH=amd64 go build -o macos/vls
cd client
mkdir out
TARGET_OS=windows TARGET_ARCH=amd64 npx vcse package -t linux-x64 -o vls-linux.vsix
rm out/*
TARGET_OS=windows TARGET_ARCH=amd64 npx vcse package -t win32-x64 -o vls-windows.vsix
rm out/*
TARGET_OS=windows TARGET_ARCH=amd64 npx vcse package -t darwin-x64 -o vls-darwin.vsix
- name: Upload Linux Artifact
uses: actions/upload-artifact@v3
with:
name: vls-linux-amd64
path: server/linux/vls
path: client/vls-linux.vsix

- name: Upload Windows Artifact
uses: actions/upload-artifact@v3
with:
name: vls-windows-amd64
path: server/windows/vls.exe
path: client/vls-windows.vsix

- name: Upload Darwin Artifact
uses: actions/upload-artifact@v3
with:
name: vls-darwin-amd64
path: server/macos/vls
path: client/vls-macos.vsix
5 changes: 4 additions & 1 deletion client/build.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import * as process from "process";
import { fileURLToPath } from 'url';

function getExecutableFilename(basename) {
if (process.platform == "win32") {
if (process.env["GOOS"] == "windows") {
return basename + ".exe";
} else {
return basename;
Expand All @@ -19,12 +19,15 @@ const dirname = path.dirname(filename);
// cd to repository root
process.chdir(path.join(dirname, ".."));

// Misc resource files
fsp.copyFile("README.md", path.join("client", "README.md"));
fsp.copyFile("LICENSE", path.join("client", "LICENSE"));

const goBuild = spawn(
"go",
["build", "-o", path.resolve("client", "bin", getExecutableFilename("verilog_language_server"))],
// Target OS and architecture should be specified to the node process running this script, e.g.
// bash -c 'GOOS=windows GOARCH=amd64 node build.mjs'
{ cwd: "server" },
);
goBuild.on('exit', exitCode => {
Expand Down

0 comments on commit 9b433a0

Please sign in to comment.