Skip to content

Commit

Permalink
ci: Build both Cli and Gui
Browse files Browse the repository at this point in the history
  • Loading branch information
Vendicated committed Jan 17, 2023
1 parent 5960fe1 commit 94cacd3
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 8 deletions.
37 changes: 29 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,14 @@ jobs:
- name: Install Go dependencies
run: go get -v

- name: Build
run: CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -v -tags static -ldflags "-s -w -X 'main.InstallerGitHash=$(git rev-parse --short HEAD)' -X 'main.InstallerTag=${{ github.ref_name }}'" -o VencordInstaller-x11
- name: Build X11 Gui
run: CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -v -tags "static gui" -ldflags "-s -w -X 'main.InstallerGitHash=$(git rev-parse --short HEAD)' -X 'main.InstallerTag=${{ github.ref_name }}'" -o VencordInstaller-x11

- name: Build Wayland Gui
run: CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -v -tags "static wayland gui" -ldflags "-s -w -X 'main.InstallerGitHash=$(git rev-parse --short HEAD)' -X 'main.InstallerTag=${{ github.ref_name }}'" -o VencordInstaller-wayland

- name: Build Wayland
run: CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -v -tags static -ldflags "-s -w -X 'main.InstallerGitHash=$(git rev-parse --short HEAD)' -X 'main.InstallerTag=${{ github.ref_name }}'" --tags wayland -o VencordInstaller-wayland
- name: Build Cli
run: CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -v -tags "static cli" -ldflags "-s -w -X 'main.InstallerGitHash=$(git rev-parse --short HEAD)' -X 'main.InstallerTag=${{ github.ref_name }}'" -o VencordInstalleCli-linux

- name: Update executable
run: |
Expand All @@ -57,6 +60,7 @@ jobs:
path: |
VencordInstaller-x11
VencordInstaller-wayland
VencordInstalleCli-linux
build-mac:
Expand Down Expand Up @@ -153,19 +157,36 @@ jobs:
go get -v
go install github.com/tc-hib/go-winres@latest
- name: Build
- name: Build Gui
shell: msys2 {0}
run: |
export GOROOT=/mingw64/lib/go
export GOPATH=/mingw64
go-winres make --product-version "git-tag"
CGO_ENABLED=1 GOOS=windows GOARCH=amd64 go build -v -tags static -ldflags "-s -w -H=windowsgui -extldflags=-static -X 'main.InstallerGitHash=$(git rev-parse --short HEAD)' -X 'main.InstallerTag=${{ github.ref_name }}'"
CGO_ENABLED=1 GOOS=windows GOARCH=amd64 go build -v -tags static -ldflags "-s -w -H=windowsgui -extldflags=-static -X 'main.InstallerGitHash=$(git rev-parse --short HEAD)' -X 'main.InstallerTag=${{ github.ref_name }}'" -o VencordInstaller.exe
- name: Build amd64 Cli
shell: msys2 {0}
run: |
export GOROOT=/mingw64/lib/go
export GOPATH=/mingw64
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -v -tags "static cli" -ldflags "-s -w -extldflags=-static -X 'main.InstallerGitHash=$(git rev-parse --short HEAD)' -X 'main.InstallerTag=${{ github.ref_name }}'" -o VencordInstallerCli-amd64.exe
- name: Build i386 Cli
shell: msys2 {0}
run: |
export GOROOT=/mingw64/lib/go
export GOPATH=/mingw64
CGO_ENABLED=0 GOOS=windows GOARCH=386 go build -v -tags "static cli" -ldflags "-s -w -extldflags=-static -X 'main.InstallerGitHash=$(git rev-parse --short HEAD)' -X 'main.InstallerTag=${{ github.ref_name }}'" -o VencordInstallerCli-i386.exe
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: VencordInstaller-windows
path: VencordInstaller.exe
path: |
VencordInstaller.exe
VencordInstallerCli-amd64.exe
VencordInstallerCli-i386.exe
release:
Expand Down Expand Up @@ -202,4 +223,4 @@ jobs:
files: |
linux/VencordInstaller-*
macos/VencordInstaller.MacOS.zip
windows/VencordInstaller.exe
windows/VencordInstall*.exe
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ Vencord Installer allows you to install [Vencord, a Discord Desktop client mod](

Download [VencordInstaller.exe](https://github.com/Vencord/Installer/releases/latest/download/VencordInstaller.exe) and run it

Alternatively, if you are on Windows 7, 32bit or the installer doesn't open for other reasons, [download the CLI from releases](https://github.com/Vencord/Installer/releases/latest/) and run it via the terminal

### Linux

```sh
Expand Down Expand Up @@ -52,6 +54,8 @@ go mod tidy

# Windows / MacOs / Linux X11
go build
# or build the Cli
go build --tags cli

# Linux Wayland
go build --tags wayland
Expand Down
2 changes: 2 additions & 0 deletions cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ func main() {
}
}

fmt.Println("Vencord Installer cli", InstallerTag, "("+InstallerGitHash+")")

if *installFlag {
_ = PromptDiscord("patch").patch()
} else if *uninstallFlag {
Expand Down

0 comments on commit 94cacd3

Please sign in to comment.