177 lines
5.5 KiB
YAML
177 lines
5.5 KiB
YAML
name: CI / CD
|
|
|
|
on: [push, pull_request]
|
|
|
|
jobs:
|
|
|
|
# bump-tag:
|
|
# if: github.ref == 'refs/heads/main'
|
|
# runs-on: ubuntu-latest
|
|
# steps:
|
|
# - uses: actions/checkout@v3
|
|
# with:
|
|
# fetch-depth: '0'
|
|
# - id: bump_version
|
|
# name: Bump version and push tag
|
|
# uses: anothrNick/github-tag-action@1.46.0
|
|
# env:
|
|
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
# WITH_V: true
|
|
# outputs:
|
|
# new_tag: ${{ steps.bump_version.outputs.new_tag }}
|
|
|
|
build-linux:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
platform: [gcc]
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- name: Setup Ninja
|
|
uses: ashutoshvarma/setup-ninja@master
|
|
with:
|
|
version: 1.10.2
|
|
- name: Build
|
|
env:
|
|
CC: ${{ steps.vars.outputs.cc }}
|
|
CXX: ${{ steps.vars.outputs.cxx }}
|
|
MATRIX_PLATFORM: ${{ matrix.platform }}
|
|
run: .github/scripts/build-linux.sh
|
|
- name: Test
|
|
run: |
|
|
cd build
|
|
ctest --verbose
|
|
- name: Upload artifact
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
uses: actions/upload-artifact@v1
|
|
with:
|
|
name: artifacts
|
|
path: linux-amd64.tar.gz
|
|
|
|
build-macos:
|
|
runs-on: macos-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- name: Setup Ninja
|
|
uses: ashutoshvarma/setup-ninja@master
|
|
with:
|
|
version: 1.10.2
|
|
- name: Build
|
|
run: |
|
|
.github/scripts/build-macos.sh
|
|
- name: Test
|
|
run: |
|
|
cd build
|
|
ctest --verbose
|
|
- name: Upload artifact
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
uses: actions/upload-artifact@v1
|
|
with:
|
|
name: artifacts
|
|
path: darwin-amd64.tar.gz
|
|
|
|
build-windows:
|
|
runs-on: windows-2019
|
|
strategy:
|
|
matrix:
|
|
platform: [x86, amd64]
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- name: Setup Ninja
|
|
uses: ashutoshvarma/setup-ninja@master
|
|
with:
|
|
version: 1.10.2
|
|
- uses: ilammy/msvc-dev-cmd@v1.4.1
|
|
with:
|
|
arch: ${{ matrix.platform }}
|
|
- name: Build
|
|
run: |
|
|
.github/scripts/build-msvc.ps1
|
|
env:
|
|
MATRIX_PLATFORM: ${{ matrix.platform }}
|
|
- name: Test
|
|
run: |
|
|
cd build
|
|
ctest --verbose -C RelWithDebInfo
|
|
- name: Upload artifact
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
uses: actions/upload-artifact@v1
|
|
with:
|
|
name: artifacts
|
|
path: windows-${{ matrix.platform }}.zip
|
|
|
|
|
|
create-release:
|
|
needs: [build-linux, build-macos, build-windows]
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Fetch build artifacts
|
|
uses: actions/download-artifact@v1
|
|
with:
|
|
name: artifacts
|
|
# - name: "Build Changelog"
|
|
# id: build_changelog
|
|
# uses: mikepenz/release-changelog-builder-action@v3
|
|
# env:
|
|
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
# with:
|
|
# configurationJson: |
|
|
# {
|
|
# "template": "#{{CHANGELOG}}\n\n<details>\n<summary>Uncategorized</summary>\n\n#{{UNCATEGORIZED}}\n</details>",
|
|
# "categories": [
|
|
# {
|
|
# "title": "## 🚀 Enhancements",
|
|
# "labels": ["feature"]
|
|
# },
|
|
# {
|
|
# "title": "## 🐛 Fixes",
|
|
# "labels": ["bug"]
|
|
# }
|
|
# ],
|
|
# }
|
|
- name: Create release
|
|
id: create_release
|
|
uses: softprops/action-gh-release@v1
|
|
with:
|
|
draft: false
|
|
prerelease: false
|
|
name: Dethrace ${{github.ref_name}}
|
|
#body: ${{steps.build_changelog.outputs.changelog}}
|
|
generate_release_notes: true
|
|
- name: Upload linux-amd64 artifact
|
|
uses: actions/upload-release-asset@v1.0.1
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
|
asset_path: ./artifacts/linux-amd64.tar.gz
|
|
asset_name: dethrace-${{github.ref_name}}-linux-amd64.tar.gz
|
|
asset_content_type: application/octet-stream
|
|
- name: Upload darwin-amd64 artifact
|
|
uses: actions/upload-release-asset@v1.0.1
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
|
asset_path: ./artifacts/darwin-amd64.tar.gz
|
|
asset_name: dethrace-${{github.ref_name}}-darwin-amd64.tar.gz
|
|
asset_content_type: application/octet-stream
|
|
- name: Upload windows-x86 artifact
|
|
uses: actions/upload-release-asset@v1.0.1
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
|
asset_path: ./artifacts/windows-x86.zip
|
|
asset_name: dethrace-${{github.ref_name}}-windows-x86.zip
|
|
asset_content_type: application/octet-stream
|
|
- name: Upload windows-amd64 artifact
|
|
uses: actions/upload-release-asset@v1.0.1
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
|
asset_path: ./artifacts/windows-amd64.zip
|
|
asset_name: dethrace-${{github.ref_name}}-windows-amd64.zip
|
|
asset_content_type: application/octet-stream |