Skip to content

Commit

Permalink
Update build scripts to automate releases
Browse files Browse the repository at this point in the history
  • Loading branch information
sturnclaw committed Jul 22, 2021
1 parent e44b894 commit 12aa6a3
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 58 deletions.
130 changes: 74 additions & 56 deletions .github/workflows/build-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ on:
paths:
- 'src/**.cpp'
- 'src/**.h'
release:
types: [published]

env:
packages: >
Expand All @@ -29,67 +31,75 @@ jobs:
runs-on: windows-2019

steps:
- uses: actions/checkout@v2
with:
path: pioneer

- name: Checkout pioneer-thirdparty
uses: actions/checkout@v2
with:
repository: pioneerspacesim/pioneer-thirdparty
path: pioneer-thirdparty

- name: Build VS Solution
shell: cmd
run: |
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
cd pioneer
msbuild win32\vs2019\pioneer.sln /property:Configuration=Release
- uses: actions/checkout@v2
with:
path: pioneer

- name: Checkout pioneer-thirdparty
uses: actions/checkout@v2
with:
repository: pioneerspacesim/pioneer-thirdparty
path: pioneer-thirdparty

- name: Build VS Solution
shell: cmd
run: |
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
cd pioneer
msbuild win32\vs2019\pioneer.sln /property:Configuration=Release
build-msvc:
runs-on: windows-2019

steps:
- uses: actions/checkout@v2
with:
path: pioneer

- name: Checkout pioneer-thirdparty
uses: actions/checkout@v2
with:
repository: pioneerspacesim/pioneer-thirdparty
path: pioneer-thirdparty

- name: Build MSVC
shell: cmd
run: |
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
cd pioneer
mkdir build
cd build
cmake .. -G Ninja -DCMAKE_INSTALL_PREFIX="C:/Program Files/Pioneer" -DPIONEER_DATA_DIR="C:/Program Files/Pioneer/data" -DCMAKE_BUILD_TYPE:STRING=Release -DGIT_EXECUTABLE="c:/Program Files/Git/cmd/git.exe"
cmake --build .
- name: Build Pioneer Data
shell: cmd
run: |
cd pioneer
modelcompiler.exe -b inplace
- name: Build Release
shell: cmd
run: |
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
cd pioneer
cd build
cmake --build . --target install
cmake --build . --target win-installer
- name: Upload Artifact
uses: actions/upload-artifact@v2
with:
name: Windows-Artifacts
path: pioneer/pioneer-*-win.exe
- uses: actions/checkout@v2
with:
path: pioneer

- name: Checkout pioneer-thirdparty
uses: actions/checkout@v2
with:
repository: pioneerspacesim/pioneer-thirdparty
path: pioneer-thirdparty

- name: Build MSVC
shell: cmd
run: |
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
cd pioneer
mkdir build
cd build
cmake .. -G Ninja -DCMAKE_INSTALL_PREFIX="C:/Program Files/Pioneer" -DPIONEER_DATA_DIR="C:/Program Files/Pioneer/data" -DCMAKE_BUILD_TYPE:STRING=Release -DGIT_EXECUTABLE="c:/Program Files/Git/cmd/git.exe"
cmake --build .
- name: Build Pioneer Data
shell: cmd
run: |
cd pioneer
modelcompiler.exe -b inplace
- name: Build Release
shell: cmd
run: |
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
cd pioneer
cd build
cmake --build . --target install
cmake --build . --target win-installer
- name: Upload Artifact
uses: actions/upload-artifact@v2
with:
name: Windows-Artifacts
path: pioneer/pioneer-*-win.exe

- name: Upload Release Files
uses: softprops/action-gh-release@v1
if: ${{ github.event_name == 'release' }}
with:
files: pioneer/pioneer-*-win.exe
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

build-gcc:
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -121,6 +131,14 @@ jobs:
name: Linux-Artifacts
path: release/zip/*.tar.gz

- name: Upload Release Files
uses: softprops/action-gh-release@v1
if: ${{ github.event_name == 'release' }}
with:
files: release/zip/pioneer-*.tar.gz
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

build-clang:
runs-on: ${{ matrix.os }}
strategy:
Expand Down
4 changes: 2 additions & 2 deletions scripts/build-travis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Package a build and prepare it for upload via Travis.

BINARIES=("build/pioneer" "build/modelcompiler")
BINARIES=("build/pioneer" "build/modelcompiler" "build/savegamedump")
COPY_DIR=release

# Append .exe to the binaries if we're building for windows.
Expand Down Expand Up @@ -54,7 +54,7 @@ mkdir -p release/zip

echo "Bundling output..."

TAG_NAME=$(git describe HEAD)
TAG_NAME=$GITHUB_REF
if [ "$BUILD_TYPE" == "mxe" ]; then
zip -r "release/zip/pioneer-$TAG_NAME-mxe.zip" release/* -x *release/zip*
else
Expand Down

0 comments on commit 12aa6a3

Please sign in to comment.