Pole #1
+58
-27
@@ -1,6 +1,12 @@
|
|||||||
name: Build libsm64
|
name: Build libsm64
|
||||||
|
|
||||||
on: [ push, pull_request ]
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- "**"
|
||||||
|
tags-ignore:
|
||||||
|
- "**"
|
||||||
|
pull_request:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
Build:
|
Build:
|
||||||
@@ -13,8 +19,6 @@ jobs:
|
|||||||
os: ubuntu-latest
|
os: ubuntu-latest
|
||||||
- identifier: windows
|
- identifier: windows
|
||||||
os: ubuntu-latest
|
os: ubuntu-latest
|
||||||
- identifier: web
|
|
||||||
os: ubuntu-latest
|
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout project
|
- name: Checkout project
|
||||||
@@ -46,16 +50,10 @@ jobs:
|
|||||||
sudo apt-get update -y -qq
|
sudo apt-get update -y -qq
|
||||||
sudo apt-get install -y libsdl2-dev libglew-dev
|
sudo apt-get install -y libsdl2-dev libglew-dev
|
||||||
|
|
||||||
- name: (Web) Set up Emscripten
|
|
||||||
if: ${{ startsWith(matrix.identifier, 'web') }}
|
|
||||||
uses: mymindstorm/setup-emsdk@v14
|
|
||||||
|
|
||||||
- name: Build shared library
|
- name: Build shared library
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
if [[ "${{ matrix.identifier }}" == "web" ]]; then
|
if [[ "${{ matrix.identifier }}" == "windows" ]]; then
|
||||||
emmake make lib -j $(nproc) CC=emcc
|
|
||||||
elif [[ "${{ matrix.identifier }}" == "windows" ]]; then
|
|
||||||
make lib -j $(nproc 2>/dev/null || sysctl -n hw.ncpu) \
|
make lib -j $(nproc 2>/dev/null || sysctl -n hw.ncpu) \
|
||||||
CC=x86_64-w64-mingw32-gcc \
|
CC=x86_64-w64-mingw32-gcc \
|
||||||
CXX=x86_64-w64-mingw32-g++
|
CXX=x86_64-w64-mingw32-g++
|
||||||
@@ -77,22 +75,55 @@ jobs:
|
|||||||
./dist
|
./dist
|
||||||
./run-test
|
./run-test
|
||||||
|
|
||||||
#Release:
|
Release:
|
||||||
# name: "Snapshot Release"
|
name: Snapshot Release
|
||||||
# runs-on: "ubuntu-latest"
|
runs-on: ubuntu-latest
|
||||||
# needs: Build
|
needs: Build
|
||||||
|
|
||||||
# steps:
|
steps:
|
||||||
# - name: Download artifacts
|
- name: Download artifacts
|
||||||
# uses: actions/download-artifact@v3
|
uses: actions/download-artifact@v3
|
||||||
|
|
||||||
# - name: Create a Release
|
- name: Create release
|
||||||
# uses: "marvinpinto/action-automatic-releases@latest"
|
id: create_release
|
||||||
# with:
|
shell: bash
|
||||||
# repo_token: "${{ secrets.GITHUB_TOKEN }}"
|
run: |
|
||||||
# automatic_release_tag: "latest"
|
RESPONSE=$(curl -s -X POST \
|
||||||
# prerelease: true
|
-H "Authorization: token ${{ secrets.RELEASE_TOKEN }}" \
|
||||||
# title: "Snapshot Build"
|
-H "Content-Type: application/json" \
|
||||||
# files: |
|
"https://git.nepu.men/api/v1/repos/NepuShiro/libsm64/releases" \
|
||||||
# ./README.md
|
-d '{
|
||||||
# ./dist
|
"tag_name": "latest",
|
||||||
|
"name": "Snapshot Build",
|
||||||
|
"prerelease": true
|
||||||
|
}')
|
||||||
|
|
||||||
|
echo "$RESPONSE"
|
||||||
|
|
||||||
|
RELEASE_ID=$(echo "$RESPONSE" | grep -o '"id":[0-9]*' | head -n 1 | grep -o '[0-9]*')
|
||||||
|
echo "release_id=$RELEASE_ID" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- name: Upload Linux artifact
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
curl -X POST \
|
||||||
|
-H "Authorization: token ${{ secrets.RELEASE_TOKEN }}" \
|
||||||
|
-F "attachment=@libsm64_linux/run-test" \
|
||||||
|
"https://git.nepu.men/api/v1/repos/NepuShiro/libsm64/releases/${{ steps.create_release.outputs.release_id }}/assets?name=run-test-linux"
|
||||||
|
|
||||||
|
- name: Upload Windows artifact
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
tar -czf windows.tar.gz libsm64_windows
|
||||||
|
curl -X POST \
|
||||||
|
-H "Authorization: token ${{ secrets.RELEASE_TOKEN }}" \
|
||||||
|
-F "attachment=@windows.tar.gz" \
|
||||||
|
"https://git.nepu.men/api/v1/repos/NepuShiro/libsm64/releases/${{ steps.create_release.outputs.release_id }}/assets?name=libsm64-windows.tar.gz"
|
||||||
|
|
||||||
|
- name: Upload README
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
curl -X POST \
|
||||||
|
-H "Authorization: token ${{ secrets.RELEASE_TOKEN }}" \
|
||||||
|
-F "attachment=@README.md" \
|
||||||
|
"https://git.nepu.men/api/v1/repos/NepuShiro/libsm64/releases/${{ steps.create_release.outputs.release_id }}/assets?name=README.md"
|
||||||
Reference in New Issue
Block a user