Skip to content

Commit

Permalink
[CI] Bump Go version
Browse files Browse the repository at this point in the history
  • Loading branch information
lexisother committed Aug 16, 2022
1 parent df29f8a commit 820640b
Show file tree
Hide file tree
Showing 2 changed files with 162 additions and 162 deletions.
322 changes: 161 additions & 161 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,161 +1,161 @@
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@v2
with:
go-version: "1.17.1"

- name: Checkout code
uses: actions/checkout@v2

- 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@v2
with:
name: installer-linux
path: installer.Linux

build-mac:
runs-on: macos-latest

steps:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: "1.17.1"

- name: Checkout code
uses: actions/checkout@v2

- 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/replugged/Info.plist -O Installer.app/Contents/Info.plist
mv installer Installer.app/Contents/MacOS/installer
wget https://public.alyxia.dev/replugged/icon.icns -O Installer.app/Contents/Resources/icon.icns
zip -r Installer.MacOS.zip Installer.app
mv Installer.MacOS.zip installer.MacOS.zip
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: installer-macos
path: installer.MacOS.zip

build-windows:
runs-on: windows-latest

steps:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: "1.17.1"

- name: Checkout code
uses: actions/checkout@v2

- 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@v2
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@v2

- uses: actions/download-artifact@v2
with:
name: installer-linux
path: linux

- uses: actions/download-artifact@v2
with:
name: installer-macos
path: macos

- uses: actions/download-artifact@v2
with:
name: installer-windows
path: windows

- name: Get some values needed for the release
id: release_values
run: |
echo "::set-output name=date::$(date '+%Y-%m-%d')"
echo "::set-output name=tag::${GITHUB_REF#refs/tags/}"
- name: Create the release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.ALYX_TOKEN }}
with:
name: ${{ steps.release_values.outputs.tag }}, ${{ steps.release_values.outputs.date }}
draft: true
prerelease: false
body_path: .github/release_body_template.md
files: |
linux/installer.Linux
macos/installer.MacOS.zip
windows/installer.exe
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@v2
with:
go-version: "1.19"

- name: Checkout code
uses: actions/checkout@v2

- 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@v2
with:
name: installer-linux
path: installer.Linux

build-mac:
runs-on: macos-latest

steps:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: "1.19"

- name: Checkout code
uses: actions/checkout@v2

- 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/replugged/Info.plist -O Installer.app/Contents/Info.plist
mv installer Installer.app/Contents/MacOS/installer
wget https://public.alyxia.dev/replugged/icon.icns -O Installer.app/Contents/Resources/icon.icns
zip -r Installer.MacOS.zip Installer.app
mv Installer.MacOS.zip installer.MacOS.zip
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: installer-macos
path: installer.MacOS.zip

build-windows:
runs-on: windows-latest

steps:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: "1.19"

- name: Checkout code
uses: actions/checkout@v2

- 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@v2
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@v2

- uses: actions/download-artifact@v2
with:
name: installer-linux
path: linux

- uses: actions/download-artifact@v2
with:
name: installer-macos
path: macos

- uses: actions/download-artifact@v2
with:
name: installer-windows
path: windows

- name: Get some values needed for the release
id: release_values
run: |
echo "::set-output name=date::$(date '+%Y-%m-%d')"
echo "::set-output name=tag::${GITHUB_REF#refs/tags/}"
- name: Create the release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.ALYX_TOKEN }}
with:
name: ${{ steps.release_values.outputs.tag }}, ${{ steps.release_values.outputs.date }}
draft: true
prerelease: false
body_path: .github/release_body_template.md
files: |
linux/installer.Linux
macos/installer.MacOS.zip
windows/installer.exe
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/replugged-org/installer

go 1.18
go 1.19

require (
github.com/ProtonMail/go-appdir v1.1.0
Expand Down

0 comments on commit 820640b

Please sign in to comment.