ooooop #46
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Based partially on Alyxia's work, thanks so much! | |
name: Release | |
on: | |
push: | |
tags: | |
- v* | |
env: | |
FORCE_COLOR: true | |
jobs: | |
build-linux: | |
runs-on: ubuntu-20.04 # hopefully older glibc for better compatibility on systems like debian bullseye | |
steps: | |
- name: Install Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: "1.19" | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cache/go-build | |
~/go/pkg/mod | |
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
restore-keys: | | |
${{ runner.os }}-go- | |
- name: Install Linux dependencies | |
run: | | |
sudo apt update | |
sudo apt install -y pkg-config libsdl2-dev libx11-dev libxcursor-dev libxrandr-dev libxinerama-dev libxi-dev libglx-dev libgl1-mesa-dev libxxf86vm-dev libwayland-dev libxkbcommon-dev wayland-protocols extra-cmake-modules | |
- name: Install Go dependencies | |
run: go get -v | |
- name: Build X11 Gui | |
run: CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -v -tags static -ldflags "-s -w -X 'vencordinstaller/buildinfo.InstallerGitHash=$(git rev-parse --short HEAD)' -X 'vencordinstaller/buildinfo.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" -ldflags "-s -w -X 'vencordinstaller/buildinfo.InstallerGitHash=$(git rev-parse --short HEAD)' -X 'vencordinstaller/buildinfo.InstallerTag=${{ github.ref_name }}'" -o VencordInstaller-wayland | |
- name: Build Cli | |
run: CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -v -tags "static cli" -ldflags "-s -w -X 'vencordinstaller/buildinfo.InstallerGitHash=$(git rev-parse --short HEAD)' -X 'vencordinstaller/buildinfo.InstallerTag=${{ github.ref_name }}'" -o VencordInstallerCli-linux | |
- name: Update executable | |
run: | | |
chmod +x VencordInstaller-* | |
- name: Upload artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: VencordInstaller-linux | |
path: | | |
VencordInstaller-x11 | |
VencordInstaller-wayland | |
VencordInstallerCli-linux | |
build-mac: | |
runs-on: macos-latest | |
steps: | |
- name: Install Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: "1.19" | |
- id: go-cache-paths | |
run: | | |
echo "go_build=$(go env GOCACHE)" >> $GITHUB_ENV | |
echo "go_mod=$(go env GOMODCACHE)" >> $GITHUB_ENV | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- uses: actions/cache@v3 | |
with: | |
path: | | |
~/Library/Caches/go-build | |
~/go/pkg/mod | |
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
restore-keys: | | |
${{ runner.os }}-go- | |
- name: Install dependencies | |
run: brew install pkg-config sdl2 | |
- name: Install Go dependencies | |
run: go get -v | |
- name: Build | |
run: CGO_ENABLED=1 GOOS=darwin GOARCH=amd64 go build -v -tags static -ldflags "-s -w -X 'vencordinstaller/buildinfo.InstallerGitHash=$(git rev-parse --short HEAD)' -X 'vencordinstaller/buildinfo.InstallerTag=${{ github.ref_name }}'" -o VencordInstaller | |
- name: Update executable | |
run: | | |
chmod +x VencordInstaller | |
- name: Generate MacOS bundle | |
run: | | |
mkdir -p VencordInstaller.app/Contents/MacOS | |
mkdir -p VencordInstaller.app/Contents/Resources | |
cp macos/Info.plist VencordInstaller.app/Contents/Info.plist | |
mv VencordInstaller VencordInstaller.app/Contents/MacOS/VencordInstaller | |
cp macos/icon.icns VencordInstaller.app/Contents/Resources/icon.icns | |
zip -r VencordInstaller.MacOS.zip VencordInstaller.app | |
- name: Upload artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: VencordInstaller-macos | |
path: VencordInstaller.MacOS.zip | |
build-windows: | |
runs-on: windows-latest | |
steps: | |
- name: Install Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: "1.19" | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- uses: actions/cache@v3 | |
with: | |
path: | | |
~\AppData\Local\go-build | |
~\go\pkg\mod | |
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
restore-keys: | | |
${{ runner.os }}-go- | |
- name: Setup MSYS2 | |
uses: msys2/setup-msys2@v2 | |
- name: Install Windows dependencies | |
shell: msys2 {0} | |
run: | | |
pacman -S --noconfirm git mingw-w64-x86_64-gcc mingw-w64-x86_64-SDL2 mingw-w64-x86_64-go | |
export GOROOT=/mingw64/lib/go | |
export GOPATH=/mingw64 | |
- name: Install Go dependencies | |
shell: msys2 {0} | |
run: | | |
export GOROOT=/mingw64/lib/go | |
export GOPATH=/mingw64 | |
go get -v | |
go install github.com/tc-hib/go-winres@latest | |
- 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 'vencordinstaller/buildinfo.InstallerGitHash=$(git rev-parse --short HEAD)' -X 'vencordinstaller/buildinfo.InstallerTag=${{ github.ref_name }}'" -o VencordInstaller.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 'vencordinstaller/buildinfo.InstallerGitHash=$(git rev-parse --short HEAD)' -X 'vencordinstaller/buildinfo.InstallerTag=${{ github.ref_name }}'" -o VencordInstallerCli.exe | |
- name: Upload artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: VencordInstaller-windows | |
path: | | |
VencordInstaller.exe | |
VencordInstallerCli.exe | |
release: | |
runs-on: ubuntu-latest | |
needs: [build-linux, build-mac, build-windows] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- uses: actions/download-artifact@v3 | |
with: | |
name: VencordInstaller-linux | |
path: linux | |
- uses: actions/download-artifact@v3 | |
with: | |
name: VencordInstaller-macos | |
path: macos | |
- uses: actions/download-artifact@v3 | |
with: | |
name: VencordInstaller-windows | |
path: windows | |
- name: Create the release | |
uses: softprops/action-gh-release@1e07f4398721186383de40550babbdf2b84acfc5 # v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
name: ${{ github.ref_name }} | |
prerelease: false | |
draft: false | |
files: | | |
linux/VencordInstalle* | |
macos/VencordInstaller.MacOS.zip | |
windows/VencordInstalle*.exe |