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:
|
2022-08-23 04:14:06 -05:00
|
|
|
prepare:
|
2019-12-17 08:03:41 -06:00
|
|
|
runs-on: ubuntu-latest
|
2021-06-03 10:32:03 -05:00
|
|
|
outputs:
|
2022-08-23 04:14:06 -05:00
|
|
|
release_upload_url: ${{ steps.create_release.outputs.upload_url }}
|
|
|
|
do_release: ${{ steps.prepare.outputs.do_release }}
|
2022-09-10 17:06:55 -05:00
|
|
|
build_matrix: ${{ steps.prepare.outputs.build_matrix }}
|
|
|
|
publish_matrix: ${{ steps.prepare.outputs.publish_matrix }}
|
2022-08-23 04:14:06 -05:00
|
|
|
release_type: ${{ steps.prepare.outputs.release_type }}
|
|
|
|
release_name: ${{ steps.prepare.outputs.release_name }}
|
|
|
|
mod_id: ${{ steps.prepare.outputs.mod_id }}
|
2022-12-17 06:53:37 -06:00
|
|
|
app_name: ${{ steps.prepare.outputs.app_name }}
|
|
|
|
app_comment: ${{ steps.prepare.outputs.app_comment }}
|
|
|
|
app_exe: ${{ steps.prepare.outputs.app_exe }}
|
|
|
|
app_id: ${{ steps.prepare.outputs.app_id }}
|
|
|
|
app_data: ${{ steps.prepare.outputs.app_data }}
|
|
|
|
app_vendor: ${{ steps.prepare.outputs.app_vendor }}
|
2022-08-23 04:14:06 -05:00
|
|
|
do_publish: ${{ steps.prepare.outputs.do_publish }}
|
2019-12-17 08:03:41 -06:00
|
|
|
steps:
|
2023-01-01 10:33:39 -06:00
|
|
|
- run: git config --global core.autocrlf false
|
2022-10-19 11:29:16 -05:00
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: actions/setup-python@v4
|
2021-04-12 14:02:57 -05:00
|
|
|
with:
|
2021-12-13 07:41:02 -06:00
|
|
|
python-version: '3.10'
|
2023-11-23 11:46:33 -06:00
|
|
|
- run: python -m pip install meson==1.2.3 ninja # TODO: go back to using latest meson once https://github.com/mesonbuild/meson/pull/12544 is live
|
2022-08-23 04:14:06 -05:00
|
|
|
- id: prepare
|
|
|
|
run: python ./.github/prepare.py
|
|
|
|
env:
|
|
|
|
PUBLISH_HOSTPORT: ${{ secrets.STARCATCHER_PUBLISH_HOSTPORT }}
|
|
|
|
GITHUB_REF: ${{ github.ref }}
|
|
|
|
- if: steps.prepare.outputs.do_release == 'yes'
|
|
|
|
id: create_release
|
2022-10-19 11:29:16 -05:00
|
|
|
uses: LBPHacker/create-release@v2
|
2019-12-17 08:03:41 -06:00
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
with:
|
|
|
|
tag_name: ${{ github.ref }}
|
2022-08-23 04:14:06 -05:00
|
|
|
release_name: ${{ steps.prepare.outputs.release_name }}
|
2019-12-17 08:03:41 -06:00
|
|
|
draft: true
|
|
|
|
prerelease: false
|
|
|
|
build:
|
2022-08-23 04:14:06 -05:00
|
|
|
runs-on: ${{ matrix.runs_on }}
|
2023-12-03 11:24:49 -06:00
|
|
|
name: ${{ matrix.job_name }}
|
2022-08-23 04:14:06 -05:00
|
|
|
needs: [prepare]
|
2019-12-17 08:03:41 -06:00
|
|
|
strategy:
|
2022-04-09 08:01:23 -05:00
|
|
|
fail-fast: false
|
2022-09-10 17:06:55 -05:00
|
|
|
matrix: ${{ fromJSON(needs.prepare.outputs.build_matrix) }}
|
2019-12-17 08:03:41 -06:00
|
|
|
steps:
|
2023-01-01 10:33:39 -06:00
|
|
|
- run: git config --global core.autocrlf false
|
2022-10-19 11:29:16 -05:00
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: actions/setup-python@v4
|
2021-04-12 14:02:57 -05:00
|
|
|
with:
|
2021-12-13 07:41:02 -06:00
|
|
|
python-version: '3.10'
|
2023-11-23 11:46:33 -06:00
|
|
|
- run: python -m pip install meson==1.2.3 ninja # TODO: go back to using latest meson once https://github.com/mesonbuild/meson/pull/12544 is live
|
2022-08-23 04:14:06 -05:00
|
|
|
- if: matrix.bsh_build_platform == 'darwin'
|
2023-01-01 10:33:39 -06:00
|
|
|
run: brew install bash coreutils
|
2021-04-16 14:02:00 -05:00
|
|
|
- run: bash -c './.github/build.sh'
|
|
|
|
env:
|
2022-08-23 04:14:06 -05:00
|
|
|
BSH_HOST_ARCH: ${{ matrix.bsh_host_arch }}
|
|
|
|
BSH_HOST_PLATFORM: ${{ matrix.bsh_host_platform }}
|
|
|
|
BSH_HOST_LIBC: ${{ matrix.bsh_host_libc }}
|
|
|
|
BSH_STATIC_DYNAMIC: ${{ matrix.bsh_static_dynamic }}
|
|
|
|
BSH_BUILD_PLATFORM: ${{ matrix.bsh_build_platform }}
|
|
|
|
BSH_DEBUG_RELEASE: ${{ matrix.bsh_debug_release }}
|
|
|
|
RELEASE_NAME: ${{ needs.prepare.outputs.release_name }}
|
|
|
|
RELEASE_TYPE: ${{ needs.prepare.outputs.release_type }}
|
|
|
|
MOD_ID: ${{ needs.prepare.outputs.mod_id }}
|
2022-12-17 06:53:37 -06:00
|
|
|
APP_NAME: ${{ needs.prepare.outputs.app_name }}
|
|
|
|
APP_COMMENT: ${{ needs.prepare.outputs.app_comment }}
|
|
|
|
APP_EXE: ${{ needs.prepare.outputs.app_exe }}
|
|
|
|
APP_ID: ${{ needs.prepare.outputs.app_id }}
|
|
|
|
APP_DATA: ${{ needs.prepare.outputs.app_data }}
|
|
|
|
APP_VENDOR: ${{ needs.prepare.outputs.app_vendor }}
|
2022-10-23 23:41:12 -05:00
|
|
|
SEPARATE_DEBUG: ${{ matrix.separate_debug }}
|
2022-11-03 01:05:31 -05:00
|
|
|
PACKAGE_MODE: ${{ matrix.package_mode }}
|
2022-08-23 04:14:06 -05:00
|
|
|
ASSET_PATH: ${{ matrix.asset_path }}
|
|
|
|
DEBUG_ASSET_PATH: ${{ matrix.debug_asset_path }}
|
2022-10-19 11:29:16 -05:00
|
|
|
- uses: LBPHacker/upload-release-asset@v2 # TODO-NTL: ship licenses
|
2022-08-23 04:14:06 -05:00
|
|
|
if: needs.prepare.outputs.do_release == 'yes' && matrix.publish == 'yes'
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
with:
|
|
|
|
upload_url: ${{ needs.prepare.outputs.release_upload_url }}
|
|
|
|
asset_path: build/${{ matrix.asset_path }}
|
|
|
|
asset_name: ${{ matrix.asset_name }}
|
2022-09-11 00:04:42 -05:00
|
|
|
asset_content_type: application/zip
|
2022-10-19 11:29:16 -05:00
|
|
|
- uses: LBPHacker/upload-release-asset@v2
|
2022-08-23 04:14:06 -05:00
|
|
|
if: needs.prepare.outputs.do_release == 'yes' && matrix.publish == 'yes' && matrix.separate_debug == 'yes'
|
2019-12-17 08:03:41 -06:00
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
with:
|
2022-08-23 04:14:06 -05:00
|
|
|
upload_url: ${{ needs.prepare.outputs.release_upload_url }}
|
|
|
|
asset_path: build/${{ matrix.debug_asset_path }}
|
|
|
|
asset_name: ${{ matrix.debug_asset_name }}
|
2022-09-11 00:04:42 -05:00
|
|
|
asset_content_type: application/zip
|
2022-10-19 11:29:16 -05:00
|
|
|
- uses: actions/upload-artifact@v3
|
2022-08-23 04:14:06 -05:00
|
|
|
if: matrix.artifact == 'yes'
|
2019-12-17 08:03:41 -06:00
|
|
|
with:
|
2022-08-23 04:14:06 -05:00
|
|
|
path: build/${{ matrix.asset_path }}
|
|
|
|
name: ${{ matrix.asset_name }}
|
2022-10-19 11:29:16 -05:00
|
|
|
- uses: actions/upload-artifact@v3
|
2022-08-23 04:14:06 -05:00
|
|
|
if: matrix.artifact == 'yes' && matrix.separate_debug == 'yes'
|
2021-04-04 15:09:16 -05:00
|
|
|
with:
|
2022-08-23 04:14:06 -05:00
|
|
|
path: build/${{ matrix.debug_asset_path }}
|
|
|
|
name: ${{ matrix.debug_asset_name }}
|
2022-09-10 17:06:55 -05:00
|
|
|
publish:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
needs: [build, prepare]
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix: ${{ fromJSON(needs.prepare.outputs.publish_matrix) }}
|
|
|
|
if: needs.prepare.outputs.do_publish == 'yes'
|
|
|
|
steps:
|
2023-01-01 10:33:39 -06:00
|
|
|
- run: git config --global core.autocrlf false
|
2022-10-19 11:29:16 -05:00
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- uses: actions/download-artifact@v3
|
2022-09-10 17:06:55 -05:00
|
|
|
with:
|
|
|
|
name: ${{ matrix.asset_name }}
|
2022-10-30 03:35:16 -05:00
|
|
|
- run: mv ${{ matrix.asset_path }} ${{ matrix.starcatcher_name }}
|
2023-08-21 16:24:22 -05:00
|
|
|
- run: sudo apt update && sudo apt install curlftpfs && bash -c './.github/starcatcher-publish.sh'
|
2021-04-16 14:02:00 -05:00
|
|
|
env:
|
2022-08-23 04:14:06 -05:00
|
|
|
PUBLISH_HOSTPORT: ${{ secrets.STARCATCHER_PUBLISH_HOSTPORT }}
|
|
|
|
PUBLISH_USERNAME: ${{ secrets.STARCATCHER_PUBLISH_USERNAME }}
|
|
|
|
PUBLISH_PASSWORD: ${{ secrets.STARCATCHER_PUBLISH_PASSWORD }}
|
2022-09-10 17:06:55 -05:00
|
|
|
PUBLISH_DIRECTORY: ${{ secrets.STARCATCHER_PUBLISH_DIRECTORY }}
|
2022-08-23 04:14:06 -05:00
|
|
|
PUBLISH_FILENAME: ${{ matrix.starcatcher_name }}
|
2022-09-10 17:06:55 -05:00
|
|
|
release:
|
2021-04-04 15:09:16 -05:00
|
|
|
runs-on: ubuntu-latest
|
2022-09-10 17:06:55 -05:00
|
|
|
needs: [build, publish, prepare]
|
2022-08-23 04:14:06 -05:00
|
|
|
if: needs.prepare.outputs.do_publish == 'yes'
|
2021-04-04 15:09:16 -05:00
|
|
|
steps:
|
2023-01-01 10:33:39 -06:00
|
|
|
- run: git config --global core.autocrlf false
|
2022-10-19 11:29:16 -05:00
|
|
|
- uses: actions/checkout@v3
|
2022-08-23 04:14:06 -05:00
|
|
|
- run: ./.github/starcatcher-release.sh
|
|
|
|
env:
|
|
|
|
RELEASE_NAME: ${{ needs.prepare.outputs.release_name }}
|
|
|
|
RELEASE_TYPE: ${{ needs.prepare.outputs.release_type }}
|
|
|
|
MOD_ID: ${{ needs.prepare.outputs.mod_id }}
|
|
|
|
GITHUB_SHA: ${{ github.sha }}
|