Skip to content

Commit

Permalink
upload artifact to gh release
Browse files Browse the repository at this point in the history
  • Loading branch information
nhanb committed Jul 1, 2022
1 parent c8a301a commit 17678d2
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 13 deletions.
4 changes: 2 additions & 2 deletions .builds/debian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ tasks:
export PATH="$PATH:/usr/lib/go-1.18/bin"
go version
make linux
make win
make windows
artifacts:
- shark/dist/shark-linux
- shark/dist/shark-win.exe
- shark/dist/shark-windows.exe
25 changes: 19 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
name: win+mac+linux

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
push

jobs:

Expand All @@ -26,7 +23,9 @@ jobs:
if: runner.os == 'Linux'
run: make deps-debian

- run: make
- name: Build for ${{ runner.os }}
run: make $(echo ${{ runner.os }} | tr '[:upper:]' '[:lower:]')
# The `tr` stuff is to convert the string to lowercase

- name: Upload ${{ runner.os }} build
uses: actions/upload-artifact@v3
Expand All @@ -36,11 +35,25 @@ jobs:

- name: Cross-compile Windows build
if: runner.os == 'Linux'
run: make win
run: make windows

- name: Upload cross-compiled Windows build
if: runner.os == 'Linux'
uses: actions/upload-artifact@v3
with:
name: Windows shark
path: dist/*.exe

- name: Upload artifacts to tagged release
if: github.ref_type == 'tag'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAG: ${{ github.ref_name }}
run: |
# Because we have multiple OSes in the build matrix, we need to either
# create a new release, or upload to the release if it already exists.
if gh release view "$TAG"; then
gh release upload "$TAG" dist/*
else
gh release create "$TAG" dist/* --generate-notes
fi
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
# Details here: https://github.com/hajimehoshi/ebiten/issues/1367

build:
go build -tags ebitensinglethread -o dist/shark
go build -tags ebitensinglethread -o dist/

linux:
GOOS=linux GOARCH=amd64 go build -tags ebitensinglethread -o dist/shark-linux

win:
GOOS=windows GOARCH=amd64 go build -tags ebitensinglethread -o dist/shark-win.exe
windows:
GOOS=windows GOARCH=amd64 go build -tags ebitensinglethread -o dist/shark-windows.exe

mac:
GOOS=darwin GOARCH=amd64 go build -tags ebitensinglethread -o dist/shark-mac
macos:
GOOS=darwin GOARCH=amd64 go build -tags ebitensinglethread -o dist/shark-macos

clean:
rm -f dist/*
Expand Down

0 comments on commit 17678d2

Please sign in to comment.