Skip to content

Commit

Permalink
[middle] Bump version to v1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
lexisother committed Nov 5, 2021
1 parent 1ed529a commit e62c864
Show file tree
Hide file tree
Showing 3 changed files with 304 additions and 303 deletions.
298 changes: 150 additions & 148 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,153 +1,155 @@
name: Build

on:
push:
branches:
- master
workflow_dispatch:
push:
branches:
- master
tags-ignore:
- "**"
workflow_dispatch:

jobs:
build-linux:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/heads/')

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 impregnate
mv impregnate impregnate.Linux
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: impregnate-linux
path: impregnate.Linux

build-mac:
runs-on: macos-latest
if: startsWith(github.ref, 'refs/heads/')

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 impregnate
mv impregnate impregnate.MacOS
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: impregnate-macos
path: impregnate.MacOS

build-windows:
runs-on: windows-latest
if: startsWith(github.ref, 'refs/heads/')

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 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: impregnate-windows
path: impregnate.exe

release:
runs-on: ubuntu-latest
needs: [build-linux, build-mac, build-windows]
if: startsWith(github.ref, 'refs/heads/')

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

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

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

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

- name: Create release
run: |
gh release delete ${{ env.VERSION }} -y || true
gh release create ${{ env.VERSION }} -p -t "${{ env.NAME }}" -n "${{ github.event.head_commit.message }}" ${{ env.FILES }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERSION: 'dev'
NAME: 'Impregnate Dev'
FILES: linux/impregnate.Linux macos/impregnate.MacOS windows/impregnate.exe
build-linux:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/heads/')

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 impregnate
mv impregnate impregnate.Linux
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: impregnate-linux
path: impregnate.Linux

build-mac:
runs-on: macos-latest
if: startsWith(github.ref, 'refs/heads/')

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 impregnate
mv impregnate impregnate.MacOS
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: impregnate-macos
path: impregnate.MacOS

build-windows:
runs-on: windows-latest
if: startsWith(github.ref, 'refs/heads/')

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 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: impregnate-windows
path: impregnate.exe

release:
runs-on: ubuntu-latest
needs: [build-linux, build-mac, build-windows]
if: startsWith(github.ref, 'refs/heads/')

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

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

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

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

- name: Create release
run: |
gh release delete ${{ env.VERSION }} -y || true
gh release create ${{ env.VERSION }} -p -t "${{ env.NAME }}" -n "${{ github.event.head_commit.message }}" ${{ env.FILES }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERSION: "dev"
NAME: "Impregnate Dev"
FILES: linux/impregnate.Linux macos/impregnate.MacOS windows/impregnate.exe
Loading

0 comments on commit e62c864

Please sign in to comment.