[middle] Fix data path not creating on Linux #17
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
name: Release | |
on: | |
push: | |
tags: | |
- v* | |
env: | |
FORCE_COLOR: true | |
jobs: | |
build-linux: | |
runs-on: ubuntu-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: | | |
~/.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 wget pkg-config libsdl2-dev | |
- 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" | |
- name: Update executable | |
run: | | |
chmod +x installer | |
mv installer installer.Linux | |
- name: Upload artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: installer-linux | |
path: installer.Linux | |
build-mac: | |
runs-on: macos-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: | | |
~/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" | |
- name: Update executable | |
run: | | |
chmod +x installer | |
- name: Generate MacOS bundle | |
run: | | |
mkdir -p Installer.app/Contents/MacOS | |
mkdir -p Installer.app/Contents/Resources | |
wget https://public.alyxia.dev/frenyard-macos-data/replugged-installer.Info.plist -O Installer.app/Contents/Info.plist | |
mv installer Installer.app/Contents/MacOS/installer | |
zip -r Installer.MacOS.zip Installer.app | |
mv Installer.MacOS.zip installer.MacOS.zip | |
- name: Upload artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: installer-macos | |
path: installer.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 | |
- name: Build | |
shell: msys2 {0} | |
run: | | |
export GOROOT=/mingw64/lib/go | |
export GOPATH=/mingw64 | |
CGO_ENABLED=1 GOOS=windows GOARCH=amd64 go build -v -tags static -ldflags "-s -w -H=windowsgui" | |
- name: Upload artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: installer-windows | |
path: installer.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: installer-linux | |
path: linux | |
- uses: actions/download-artifact@v3 | |
with: | |
name: installer-macos | |
path: macos | |
- uses: actions/download-artifact@v3 | |
with: | |
name: installer-windows | |
path: windows | |
- name: Get some values needed for the release | |
id: release_values | |
run: | | |
echo "release_date=$(date '+%Y-%m-%d')" >> $GITHUB_ENV | |
echo "release_tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV | |
- name: Create the release | |
uses: softprops/action-gh-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.ALYX_TOKEN }} | |
with: | |
name: ${{ env.release_tag }}, ${{ env.release_date }} | |
draft: true | |
prerelease: false | |
body_path: .github/release_body_template.md | |
files: | | |
linux/installer.Linux | |
macos/installer.MacOS.zip | |
windows/installer.exe |