Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/hismailbulut/Neoray
Browse files Browse the repository at this point in the history
  • Loading branch information
hismailbulut committed Aug 18, 2021
2 parents 4e508e6 + b5c9d58 commit c421526
Showing 1 changed file with 123 additions and 0 deletions.
123 changes: 123 additions & 0 deletions .github/workflows/release.yml
@@ -0,0 +1,123 @@
name: Release

on:
workflow_dispatch:

jobs:
build-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.16

- name: Build amd64
env:
CGO_ENABLED: 1
GOOS: windows
GOARCH: amd64
run: go build -ldflags -H=windowsgui -o bin/neoray-win64.exe ./src

- name: Set up MinGW x86
uses: egor-tensin/setup-mingw@v2
with:
platform: x86

- name: Build 386
env:
CGO_ENABLED: 1
GOOS: windows
GOARCH: 386
run: go build -ldflags -H=windowsgui -o bin/neoray-win32.exe ./src

- name: Upload binaries
uses: actions/upload-artifact@v2
if: success()
with:
name: windows-binaries
path: |
bin/neoray-win64.exe
bin/neoray-win32.exe
build-macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.16

- name: Build amd64
env:
CGO_ENABLED: 1
GOOS: darwin
GOARCH: amd64
run: go build -o bin/neoray-macos ./src

- name: Upload binaries
uses: actions/upload-artifact@v2
if: success()
with:
name: macos-binaries
path: |
bin/neoray-macos
build-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.16

- name: Set up required libs
run: |
sudo apt update && sudo apt upgrade
sudo apt install libx11-dev libgtk-3-dev libgl1-mesa-dev xorg-dev
- name: Build amd64
env:
CGO_ENABLED: 1
GOOS: linux
GOARCH: amd64
run: go build -o bin/neoray-linux64 ./src

- name: Upload binaries
uses: actions/upload-artifact@v2
if: success()
with:
name: linux-binaries
path: |
bin/neoray-linux64
release:
runs-on: ubuntu-latest
needs: [build-windows, build-macos, build-linux]
if: success()
steps:
- name: Download binaries
uses: actions/download-artifact@v2

- name: Print files
run: ls -A -l -h --color=auto

- name: Deploy latest release
uses: "marvinpinto/action-automatic-releases@latest"
if: success()
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "latest"
prerelease: false
title: "Latest release"
files: |
windows-binaries/neoray-win64.exe
windows-binaries/neoray-win32.exe
macos-binaries/neoray-macos
linux-binaries/neoray-linux64

0 comments on commit c421526

Please sign in to comment.