Skip to content

Commit

Permalink
Enable release builds with v-tags (#310)
Browse files Browse the repository at this point in the history
Re-enable release builds push into Github releases page when new v-prefixed tags are pushed (i.e. v2.4.2).
  • Loading branch information
sergystepanov authored Apr 7, 2021
1 parent 602b9ea commit 65dcaf7
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 78 deletions.
14 changes: 3 additions & 11 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ jobs:
- name: Get Linux dev libraries and tools
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y make pkg-config libvpx-dev libx264-dev libopus-dev libsdl2-dev libgl1-mesa-glx
sudo apt-get -qq update
sudo apt-get -qq install -y make pkg-config libvpx-dev libx264-dev libopus-dev libsdl2-dev libgl1-mesa-glx
- name: Get MacOS dev libraries and tools
if: matrix.os == 'macos-latest'
Expand All @@ -46,7 +46,7 @@ jobs:
with:
msystem: MINGW64
path-type: inherit
update: true
release: false
install: >
mingw-w64-x86_64-gcc
mingw-w64-x86_64-pkg-config
Expand All @@ -65,14 +65,6 @@ jobs:
echo -e " 2\r\n 8\r\n " >> commands
./mesa/systemwidedeploy.cmd < ./commands
- name: Load Go modules maybe?
uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Build Windows app
if: matrix.step == 'build' && matrix.os == 'windows-latest'
shell: msys2 {0}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ on:
tags:
- 'v*'
env:
go-version: 1.15
app-name: cloud-game
app-arch: x86_64
jobs:
Expand All @@ -33,79 +32,74 @@ jobs:
name: Build
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
os: [ ubuntu-latest, macos-latest, windows-latest ]
runs-on: ${{ matrix.os }}
env:
release-dir: _release
steps:
- name: Get the source
uses: actions/checkout@v2
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: ${{ env.go-version }}
- uses: actions/checkout@v2

- name: Get Linux dev libraries and tools
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y make pkg-config libvpx-dev libx264-dev libopus-dev libopusfile-dev libsdl2-dev
- uses: actions/setup-go@v2
with:
go-version: ^1.16

- name: Get MacOS dev libraries and tools
if: matrix.os == 'macos-latest'
run: |
brew install pkg-config libvpx x264 opus opusfile sdl2
- name: Get Linux dev libraries and tools
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get -qq update
sudo apt-get -qq install -y make pkg-config libvpx-dev libx264-dev libopus-dev libsdl2-dev libgl1-mesa-glx
- name: Get Windows dev libraries and tools
if: matrix.os == 'windows-latest'
uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
path-type: inherit
update: true
- name: Get MacOS dev libraries and tools
if: matrix.os == 'macos-latest'
run: |
brew install pkg-config libvpx x264 opus sdl2
- name: Load Go modules maybe?
uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Get Windows dev libraries and tools
if: matrix.os == 'windows-latest'
uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
path-type: inherit
release: false
install: >
mingw-w64-x86_64-gcc
mingw-w64-x86_64-pkg-config
mingw-w64-x86_64-dlfcn
mingw-w64-x86_64-libvpx
mingw-w64-x86_64-opus
mingw-w64-x86_64-x264-git
mingw-w64-x86_64-SDL2
- name: Build Windows app
if: matrix.os == 'windows-latest'
shell: msys2 {0}
run: >
pacman -S --noconfirm --needed make
mingw-w64-x86_64-gcc
mingw-w64-x86_64-pkg-config
mingw-w64-x86_64-dlfcn
mingw-w64-x86_64-libvpx
mingw-w64-x86_64-x264-git
mingw-w64-x86_64-opusfile
mingw-w64-x86_64-SDL2
- name: Build Windows app
if: matrix.os == 'windows-latest'
shell: msys2 {0}
run: |
EXT=.exe make release RELEASE_DIR=${{ env.release-dir }} DLIB_SEARCH_PATTERN=/mingw.*dll CORE_EXT=*.dll
make release RELEASE_DIR=${{ env.release-dir }} DLIB_SEARCH_PATTERN=/mingw.*dll CORE_EXT=*.dll
- name: Build Linux app
if: matrix.os == 'ubuntu-latest'
run: |
EXT_WFLAGS="-ldflags '-extldflags \"-Wl,-rpath=\$\$ORIGIN\"'" \
make release RELEASE_DIR=${{ env.release-dir }} \
DLIB_SEARCH_PATTERN="/lib/.*?lib\(x264\|vpx\|opus\).*?\ " \
CORE_EXT=*_libretro.so
- name: Build Linux app
if: matrix.os == 'ubuntu-latest'
run: |
make release RELEASE_DIR=${{ env.release-dir }} DLIB_SEARCH_PATTERN=/usr/lib.*\\\\s CORE_EXT=*_libretro.so
cp ./scripts/install.sh ${{ env.release-dir }}
- name: Build macOS app
if: matrix.os == 'macos-latest'
run: |
# skip copy libs due to outrageous otool behaviour, depend on sys install
# should be recursive + paths rewritten to @executable_path
# lddx seems to be working ok
go get github.com/jtanx/lddx
make release RELEASE_DIR=${{ env.release-dir }} DLIB_ALTER=true DLIB_TOOL="lddx -r -c" CORE_EXT=*.dylib
- name: Build macOS app
if: matrix.os == 'macos-latest'
run: |
# skip copy libs due to outrageous otool behaviour, depend on sys install
# should be recursive + paths rewritten to @executable_path
# lddx seems to be working ok
go get github.com/jtanx/lddx
make release RELEASE_DIR=${{ env.release-dir }} DLIB_ALTER=true DLIB_TOOL="lddx -r -c" CORE_EXT=*.dylib
- name: Save built app for upload
uses: actions/upload-artifact@v1
with:
name: ${{ runner.os }}
path: ${{ env.release-dir }}
- name: Save built app for upload
uses: actions/upload-artifact@v1
with:
name: ${{ runner.os }}
path: ${{ env.release-dir }}

release:
name: Create or find Github release
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ ARG BUILD_PATH
WORKDIR ${BUILD_PATH}

# system libs layer
RUN apt-get update && apt-get install --no-install-recommends -y \
RUN apt-get -qq update && apt-get -qq install --no-install-recommends -y \
gcc \
ca-certificates \
libopus-dev \
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ clean:

build:
CGO_ENABLED=0 go build -ldflags '-w -s' -o bin/coordinator$(EXT) ./cmd/coordinator
go build -buildmode=exe -tags static -ldflags '-w -s' -o bin/worker$(EXT) ./cmd/worker
go build -buildmode=exe -tags static -ldflags '-w -s' $(EXT_WFLAGS) -o bin/worker$(EXT) ./cmd/worker

verify-cores:
go test -run TestAllEmulatorRooms ./pkg/worker/room -v -renderFrames $(GL_CTX) -outputPath "../../../_rendered"
Expand Down Expand Up @@ -126,7 +126,7 @@ release: clean build
cp ./bin/coordinator $(COORDINATOR_DIR) && cp ./bin/worker $(WORKER_DIR)
chmod +x $(COORDINATOR_DIR)/coordinator $(WORKER_DIR)/worker
ifeq ($(DLIB_ALTER),false)
for bin in $$($(DLIB_TOOL) $(WORKER_DIR)/worker | grep -o $(DLIB_SEARCH_PATTERN)); \
for bin in $$($(DLIB_TOOL) $(WORKER_DIR)/worker | grep -oE $(DLIB_SEARCH_PATTERN)); \
do cp -v "$$bin" $(WORKER_DIR); \
done
else
Expand Down
5 changes: 2 additions & 3 deletions scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@ then
exit 1
fi

apt-get update
apt-get install --no-install-recommends -y \
apt-get -qq update
apt-get -qq install --no-install-recommends -y \
libvpx6 \
libx264-160 \
libopus0 \
libsdl2-2.0-0 \
libgl1-mesa-glx \
xvfb

0 comments on commit 65dcaf7

Please sign in to comment.