Repos / shark / d54aff4f86
commit d54aff4f86191a6940f79796458b08ca7271283c
Author: Bùi Thành Nhân <hi@imnhan.com>
Date:   Thu Jun 30 18:31:26 2022 +0700

    write makefile; build everything into dist/

diff --git a/.builds/debian.yml b/.builds/debian.yml
index e8d4f65..18131e6 100644
--- a/.builds/debian.yml
+++ b/.builds/debian.yml
@@ -22,9 +22,9 @@ tasks:
       cd shark
       export PATH="$PATH:/usr/lib/go-1.18/bin"
       go version
-      go build -o shark-linux
-      GOOS=windows GOARCH=amd64 go build -o shark-win.exe
+      make linux
+      make win
 
 artifacts:
-  - shark/shark-linux
-  - shark/shark-win.exe
+  - shark/dist/shark-linux
+  - shark/dist/shark-win.exe
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index f498e6d..7b54063 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -1,39 +1,34 @@
-name: Go package
+name: Build
 
 on: [push]
 
 jobs:
   build:
-
     runs-on: ['ubuntu-latest', 'windows-latest', 'macos-latest']
     steps:
       - uses: actions/checkout@v3
-
       - name: Set up Go
         uses: actions/setup-go@v3
         with:
           go-version: 1.18
-
       - name: Build
         run: go build -v ./...
-
       - name: Upload linux
-        if: runner.os == 'Linux'
+        #if: runner.os == 'Linux'
         uses: actions/upload-artifact@v3
         with:
           name: shark-linux
           path: shark
-
-      - name: Upload macOS
-        if: runner.os == 'macOS'
-        uses: actions/upload-artifact@v3
-        with:
-          name: shark-osx
-          path: shark
-
-      - name: Upload Windows
-        if: runner.os == 'Windows'
-        uses: actions/upload-artifact@v3
-        with:
-          name: shark-win.exe
-          path: shark.exe
+      #- name: Upload macOS
+        #if: runner.os == 'macOS'
+        #uses: actions/upload-artifact@v3
+        #with:
+          #name: shark-osx
+          #path: shark
+
+      #- name: Upload Windows
+        #if: runner.os == 'Windows'
+        #uses: actions/upload-artifact@v3
+        #with:
+          #name: shark-win.exe
+          #path: shark.exe
diff --git a/.gitignore b/.gitignore
index 1880ce9..9b1c8b1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1 @@
-/shark
-/shark.exe
+/dist
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..f32a4b2
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,14 @@
+# All builds use the `ebitensinglethread` tag to shave off some CPU usage.
+# Details here: https://github.com/hajimehoshi/ebiten/issues/1367
+
+build:
+	go build -tags ebitensinglethread -o dist/shark
+
+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
+
+clean:
+	rm -f dist/*