mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2024-11-14 20:28:21 +00:00
90 lines
2.4 KiB
YAML
90 lines
2.4 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
paths:
|
|
- versions.txt
|
|
|
|
jobs:
|
|
build-and-test:
|
|
name: Build & Test (${{ matrix.os }})
|
|
runs-on: ${{ matrix.os }}
|
|
continue-on-error: true
|
|
strategy:
|
|
matrix:
|
|
os: [ windows-2022, ubuntu-20.04 ]
|
|
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
submodules: true
|
|
- name: Add msbuild to PATH (Windows only)
|
|
if: ${{ matrix.os == 'windows-2022' }}
|
|
uses: microsoft/setup-msbuild@v1.1
|
|
with:
|
|
vs-version: '[17,18)'
|
|
msbuild-architecture: x64
|
|
- name: Install libssl (Mac Only)
|
|
if: ${{ matrix.os == 'macos-11' }}
|
|
run: brew install openssl@3
|
|
- name: cmake
|
|
uses: lukka/run-cmake@v10
|
|
with:
|
|
configurePreset: "ci-${{matrix.os}}"
|
|
buildPreset: "ci-${{matrix.os}}"
|
|
testPreset: "ci-${{matrix.os}}"
|
|
- name: artifacts
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: build-${{matrix.os}}
|
|
path: |
|
|
build/*Server*
|
|
build/*.ini
|
|
build/*.so
|
|
build/*.dll
|
|
build/vanity/
|
|
build/navmeshes/
|
|
build/migrations/
|
|
build/*.dcf
|
|
!build/*.pdb
|
|
!build/d*/
|
|
|
|
draft-release:
|
|
needs: build-and-test
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Download artifacts
|
|
uses: actions/download-artifact@v2
|
|
with:
|
|
name: artifacts
|
|
|
|
- name: Create Release
|
|
id: create_release
|
|
uses: actions/create-release@v1
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
tag_name: v0.0.0-${{ github.run_number }}
|
|
release_name: Release v0.0.0-${{ github.run_number }}
|
|
body: Draft release for version v0.0.0-${{ github.run_number }}
|
|
draft: true
|
|
|
|
- name: Download all workflow run artifacts
|
|
uses: actions/download-artifact@v3
|
|
|
|
- name: Upload Release Assets
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
run: |
|
|
for file in artifacts/*; do
|
|
echo "Uploading $file"
|
|
curl --progress-bar \
|
|
-X POST \
|
|
-H "Accept: application/vnd.github+json" \
|
|
-H "Authorization: token ${{ env.GITHUB_TOKEN }}" \
|
|
--upload-file "$file" \
|
|
-H "Content-Type: $(file --mime-type -b $file)" \
|
|
"https://uploads.github.com/repos/${{ github.repository }}/releases/${{ steps.create_release.outputs.id }}/assets?name=$(basename $file)"
|
|
done
|