2019-12-17 08:03:41 -06:00
name : build
on :
push :
branches :
- '*'
tags :
- 'v*.*'
- 'snapshot-*'
2022-04-09 08:01:23 -05:00
- 'tptlibsdev-*'
2019-12-17 08:03:41 -06:00
pull_request :
branches :
- '*'
jobs :
release :
runs-on : ubuntu-latest
2021-06-03 10:32:03 -05:00
outputs :
upload_url : ${{ steps.create_release.outputs.upload_url }}
can_publish : ${{ steps.starcatcher_check.outputs.can_publish }}
2019-12-17 08:03:41 -06:00
steps :
- uses : actions/checkout@v2
- uses : actions/setup-python@v2
2021-04-12 14:02:57 -05:00
with :
2021-12-13 07:41:02 -06:00
python-version : '3.10'
2019-12-17 08:03:41 -06:00
- id : get_type
2021-04-12 14:02:57 -05:00
run : python3 ./.github/get-type.py ${{ github.ref }}
2019-12-17 08:03:41 -06:00
- id : create_release
if : steps.get_type.outputs.TYPE != 'dev'
uses : actions/create-release@v1
env :
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
with :
tag_name : ${{ github.ref }}
release_name : ${{ steps.get_type.outputs.NAME }}
draft : true
prerelease : false
2021-06-03 10:32:03 -05:00
- id : starcatcher_check
if : steps.get_type.outputs.TYPE != 'dev'
run : bash -c './.github/starcatcher-check.sh'
env :
STARCATCHER_PUBLISH_HOSTPORT : ${{ secrets.STARCATCHER_PUBLISH_HOSTPORT }}
2019-12-17 08:03:41 -06:00
build :
runs-on : ${{ matrix.os }}
needs : [ release]
strategy :
2022-04-09 08:01:23 -05:00
fail-fast : false
2019-12-17 08:03:41 -06:00
matrix :
2022-04-11 14:11:03 -05:00
# | x86_64 | i686 | arm64 | arm
# | lin | mac | win | and | lin | mac | win | and | lin | mac | win | and | lin | mac | win | and
# ---------------+------+------+------+------+------+------+------+------+------+------+------+------+------+------+------+------
# gcc | | | NO | | NO | NO | NO | | NO | | NO | | NO | NO | NO |
# static msvc | NO | NO | | NO | NO | NO | | NO | NO | NO | NO | NO | NO | NO | NO | NO
# mingw | | NO | | NO | NO | NO | NO | NO | NO | NO | NO | NO | NO | NO | NO | NO
# gcc | | | NO | NO | NO | NO | NO | NO | NO |NO [1]| NO | NO | NO | NO | NO | NO
# dynamic msvc | NO | NO | | NO | NO | NO | | NO | NO | NO | NO | NO | NO | NO | NO | NO
# mingw | | NO | | NO | NO | NO | NO | NO | NO | NO | NO | NO | NO | NO | NO | NO
2022-02-16 06:31:31 -06:00
#
# [1] This is only required for development on ARM Macs. We have no access to such devices, so someone will
# have to help us figure out how to get dynamic libraries.
2021-03-12 14:02:02 -06:00
#
2021-04-04 15:09:16 -05:00
# Please keep this matrix in sync with the other one in this file, see the ### blocks.
2021-10-22 09:38:42 -05:00
# The only difference should be that the second matrix has all mingw cells disabled; we don't publish mingw builds on starcatcher.
2021-04-04 15:09:16 -05:00
#########################################################
############# BEGIN BLOCK FOR COPYING BELOW #############
#########################################################
2022-04-11 14:11:03 -05:00
machine_short : [ x86_64, i686, arm64, arm]
platform_short : [ lin, mac, win, and]
2021-03-12 14:02:02 -06:00
toolset_short : [ gcc, msvc, mingw]
2019-12-17 08:03:41 -06:00
static_dynamic : [ static, dynamic]
2021-03-12 14:02:02 -06:00
exclude :
- toolset_short : mingw
2021-10-22 09:38:42 -05:00
machine_short : i686 # remove this line after copying the matrix below
- toolset_short : mingw # remove this line after copying the matrix below
platform_short : mac # remove this line after copying the matrix below
2021-03-12 14:02:02 -06:00
- machine_short : i686
platform_short : lin
- machine_short : i686
platform_short : mac
- toolset_short : msvc
platform_short : lin
- toolset_short : msvc
platform_short : mac
- toolset_short : gcc
platform_short : win
2022-02-16 06:31:31 -06:00
- platform_short : lin
machine_short : arm64
- platform_short : win
machine_short : arm64
- platform_short : mac # see [1]
static_dynamic : dynamic
machine_short : arm64
2022-04-11 14:11:03 -05:00
- platform_short : and
static_dynamic : dynamic
- platform_short : and
toolset_short : msvc
- platform_short : and
toolset_short : mingw
- platform_short : lin
machine_short : arm
- platform_short : win
machine_short : arm
- platform_short : mac
machine_short : arm
2021-04-04 15:09:16 -05:00
#########################################################
############## END BLOCK FOR COPYING BELOW ##############
#########################################################
2019-12-17 08:03:41 -06:00
include :
- platform_short : lin
2021-07-12 13:47:41 -05:00
os : ubuntu-18.04
2022-04-11 14:11:03 -05:00
prefix : ''
2021-01-21 12:08:27 -06:00
suffix : ''
2019-12-17 08:03:41 -06:00
- platform_short : mac
2022-02-16 06:31:31 -06:00
os : macos-11.0
2022-04-11 14:11:03 -05:00
prefix : ''
2021-01-21 12:08:27 -06:00
suffix : ''
2019-12-17 08:03:41 -06:00
- platform_short : win
2021-10-22 09:38:42 -05:00
os : windows-2019
2022-04-11 14:11:03 -05:00
prefix : ''
2021-01-21 12:08:27 -06:00
suffix : '.exe'
2021-12-24 10:43:44 -06:00
- platform_short : lin
toolset_short : mingw
os : ubuntu-20.04
2022-04-11 14:11:03 -05:00
prefix : ''
2021-12-24 10:43:44 -06:00
suffix : '.exe'
2022-04-11 14:11:03 -05:00
- platform_short : and
os : ubuntu-18.04
prefix : ''
suffix : '.apk'
2019-12-17 08:03:41 -06:00
steps :
- uses : actions/checkout@v2
- uses : actions/setup-python@v2
2021-04-12 14:02:57 -05:00
with :
2021-12-13 07:41:02 -06:00
python-version : '3.10'
2019-12-17 08:03:41 -06:00
- id : get_type
2021-04-12 14:02:57 -05:00
run : python3 ./.github/get-type.py ${{ github.ref }}
2021-12-24 10:43:44 -06:00
- if : matrix.platform_short == 'lin' && matrix.toolset_short == 'mingw'
run : sudo apt update && sudo apt install g++-mingw-w64-x86-64
2021-04-12 14:02:57 -05:00
- if : matrix.platform_short == 'mac'
2022-04-09 08:01:23 -05:00
run : brew install pkg-config coreutils
2019-12-17 08:03:41 -06:00
- if : matrix.platform_short == 'mac' && matrix.static_dynamic != 'static'
run : brew install luajit curl fftw zlib sdl2
- if : matrix.platform_short == 'lin' && matrix.static_dynamic != 'static'
run : sudo apt update && sudo apt install libluajit-5.1-dev libcurl4-openssl-dev libfftw3-dev zlib1g-dev libsdl2-dev
2021-04-12 14:02:57 -05:00
- run : python3 -m pip install meson ninja
2021-04-16 14:02:00 -05:00
- run : bash -c './.github/build.sh'
env :
PLATFORM_SHORT : ${{ matrix.platform_short }}
MACHINE_SHORT : ${{ matrix.machine_short }}
TOOLSET_SHORT : ${{ matrix.toolset_short }}
STATIC_DYNAMIC : ${{ matrix.static_dynamic }}
RELNAME : ${{ steps.get_type.outputs.NAME }}
2021-04-16 16:20:38 -05:00
RELTYPE : ${{ steps.get_type.outputs.TYPE }}
2021-04-16 14:02:00 -05:00
MOD_ID : ${{ steps.get_type.outputs.MOD_ID }}
2019-12-17 08:03:41 -06:00
- uses : actions/upload-release-asset@v1
if : steps.get_type.outputs.TYPE != 'dev' && matrix.static_dynamic == 'static'
env :
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
with :
2021-06-03 10:32:03 -05:00
upload_url : ${{ needs.release.outputs.upload_url }}
2022-04-11 14:11:03 -05:00
asset_path : ${{ matrix.prefix }}powder${{ matrix.suffix }}
asset_name : ${{ matrix.prefix }}powder-${{ steps.get_type.outputs.NAME }}-${{ matrix.machine_short }}-${{ matrix.platform_short }}-${{ matrix.toolset_short }}-${{ matrix.static_dynamic }}${{ matrix.suffix }}
2019-12-17 08:03:41 -06:00
asset_content_type : application/zip
- uses : actions/upload-artifact@v2
2021-04-04 15:09:16 -05:00
if : matrix.static_dynamic == 'static'
2019-12-17 08:03:41 -06:00
with :
2022-04-11 14:11:03 -05:00
path : ${{ matrix.prefix }}powder${{ matrix.suffix }}
name : ${{ matrix.prefix }}powder-${{ steps.get_type.outputs.NAME }}-${{ matrix.machine_short }}-${{ matrix.platform_short }}-${{ matrix.toolset_short }}-${{ matrix.static_dynamic }}${{ matrix.suffix }}
2021-11-08 08:31:07 -06:00
starcatcher-publish :
2021-04-04 15:09:16 -05:00
runs-on : ubuntu-latest
2021-06-03 10:32:03 -05:00
needs : [ build, release]
if : needs.release.outputs.can_publish == 'yes' && startsWith(github.ref, 'refs/tags/') # not a perfect match but get-type.py takes care of this in job build
2021-04-04 15:09:16 -05:00
strategy :
2022-04-09 08:01:23 -05:00
fail-fast : false
2021-04-04 15:09:16 -05:00
matrix :
#########################################################
############# BEGIN BLOCK COPIED FROM ABOVE #############
#########################################################
2022-04-18 23:25:04 -05:00
machine_short : [ x86_64, i686, arm64, arm]
platform_short : [ lin, mac, win, and]
2021-04-04 15:09:16 -05:00
toolset_short : [ gcc, msvc, mingw]
static_dynamic : [ static, dynamic]
exclude :
- toolset_short : mingw
- machine_short : i686
platform_short : lin
- machine_short : i686
platform_short : mac
- toolset_short : msvc
platform_short : lin
- toolset_short : msvc
platform_short : mac
- toolset_short : gcc
platform_short : win
2022-02-16 06:31:31 -06:00
- platform_short : lin
machine_short : arm64
- platform_short : win
machine_short : arm64
- platform_short : mac # see [1]
static_dynamic : dynamic
machine_short : arm64
2022-04-11 14:11:03 -05:00
- platform_short : and
static_dynamic : dynamic
- platform_short : and
toolset_short : msvc
- platform_short : and
toolset_short : mingw
- platform_short : lin
machine_short : arm
- platform_short : win
machine_short : arm
- platform_short : mac
machine_short : arm
2021-04-04 15:09:16 -05:00
#########################################################
############## END BLOCK COPIED FROM ABOVE ##############
#########################################################
- static_dynamic : dynamic
include :
- platform_short : lin
2022-04-11 14:11:03 -05:00
prefix : ''
2021-04-04 15:09:16 -05:00
suffix : ''
- platform_short : mac
2022-04-11 14:11:03 -05:00
prefix : ''
2021-04-04 15:09:16 -05:00
suffix : ''
- platform_short : win
2022-04-11 14:11:03 -05:00
prefix : ''
2021-04-04 15:09:16 -05:00
suffix : '.exe'
2022-04-11 14:11:03 -05:00
- platform_short : and
prefix : ''
suffix : '.apk'
2021-04-04 15:09:16 -05:00
steps :
- uses : actions/checkout@v2
- uses : actions/setup-python@v2
2021-04-12 14:02:57 -05:00
with :
2021-12-13 07:41:02 -06:00
python-version : '3.10'
2021-04-04 15:09:16 -05:00
- id : get_type
2021-04-12 14:02:57 -05:00
run : python3 ./.github/get-type.py ${{ github.ref }}
2021-04-04 15:09:16 -05:00
- uses : actions/download-artifact@v1
with :
2022-04-11 14:11:03 -05:00
name : ${{ matrix.prefix }}powder-${{ steps.get_type.outputs.NAME }}-${{ matrix.machine_short }}-${{ matrix.platform_short }}-${{ matrix.toolset_short }}-${{ matrix.static_dynamic }}${{ matrix.suffix }}
2021-04-04 15:09:16 -05:00
- run : sudo apt update && sudo apt install lftp
- if : steps.get_type.outputs.TYPE != 'dev' && matrix.static_dynamic == 'static'
2022-04-11 14:11:03 -05:00
run : bash -c './.github/starcatcher-publish.sh ${{ matrix.prefix }}powder${{ matrix.suffix }}'
2021-04-16 14:02:00 -05:00
env :
STARCATCHER_PUBLISH_HOSTPORT : ${{ secrets.STARCATCHER_PUBLISH_HOSTPORT }}
STARCATCHER_PUBLISH_USERNAME : ${{ secrets.STARCATCHER_PUBLISH_USERNAME }}
STARCATCHER_PUBLISH_PASSWORD : ${{ secrets.STARCATCHER_PUBLISH_PASSWORD }}
2022-04-11 14:11:03 -05:00
STARCATCHER_PUBLISH_FILENAME : ${{ matrix.prefix }}powder-${{ steps.get_type.outputs.NAME }}-${{ matrix.machine_short }}-${{ matrix.platform_short }}-${{ matrix.toolset_short }}-${{ matrix.static_dynamic }}${{ matrix.suffix }}
2021-04-04 15:09:16 -05:00
starcatcher-release :
runs-on : ubuntu-latest
2021-11-08 08:31:07 -06:00
needs : [ starcatcher-publish, release]
2021-06-03 10:32:03 -05:00
if : needs.release.outputs.can_publish == 'yes' && startsWith(github.ref, 'refs/tags/') # not a perfect match but get-type.py takes care of this in job build
2021-04-04 15:09:16 -05:00
steps :
- uses : actions/checkout@v2
- uses : actions/setup-python@v2
2021-04-12 14:02:57 -05:00
with :
2021-12-13 07:41:02 -06:00
python-version : '3.10'
2021-04-04 15:09:16 -05:00
- id : get_type
2021-04-12 14:02:57 -05:00
run : python3 ./.github/get-type.py ${{ github.ref }}
2021-11-17 13:38:16 -06:00
- run : ./.github/starcatcher-release.sh "https://starcatcher.us/TPT/perform-release.lua?mod=${{ steps.get_type.outputs.MOD_ID }}&type=${{ steps.get_type.outputs.TYPE }}&name=${{ steps.get_type.outputs.NAME }}&commit=${{ github.sha }}"