Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[EN-6891] Add samples build #16

Merged
merged 19 commits into from
Jun 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,6 @@
name: CI

on:
push:
tags:
- 'v[0-9]+\.[0-9]+\.[0-9]+'
- 'v[0-9]+\.[0-9]+\.[0-9]+-[a-zA-Z]+'
branches:
- 'main'
pull_request:
workflow_dispatch:

Expand Down
74 changes: 62 additions & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,55 @@ name: release

on:
workflow_dispatch:

env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: 'Release'
inputs:
publish:
description: 'Publish The Release'
default: 'true'
required: true
type: boolean
use_latest_tag:
description: 'Try To Use The Latest Git Tag'
default: 'false'
required: true
type: boolean
push:
tags:
- 'v*.*.*'

jobs:
get_version:
name: Get Version
runs-on: ubuntu-latest
outputs:
version: ${{ steps.set_version.outputs.version }}
tag_name: ${{ steps.set_version.outputs.tag_name }}
steps:
- uses: actions/checkout@v3
- id: get_latest_tag
run: |
echo "tag=$(git describe --abbrev=0 --tags)" >> $GITHUB_OUTPUT

- id: set_version
run: |
if [[ "${{ !inputs.use_latest_tag && startsWith(github.ref, 'refs/tags/') }}" == "true" ]]
then
echo "version=${{github.ref_name}}" >> $GITHUB_OUTPUT
echo "tag_name=${{github.ref}}" >> $GITHUB_OUTPUT
else
echo "version=${{ steps.get_latest_tag.outputs.tag }}" >> $GITHUB_OUTPUT
echo "tag_name=${{ format('refs/tags/{0}', steps.get_latest_tag.outputs.tag) }}" >> $GITHUB_OUTPUT
fi

build_package_and_upload:
name: Build, Package & Upload
needs: [get_version]
strategy:
matrix:
# os: [windows-latest, macos-latest, ubuntu-latest]
os: [ windows-latest, macos-latest, ubuntu-22.04 ]
buildType: [ Release, Debug ]
#os: [ ubuntu-22.04 ]
#buildType: [ Release, Debug ]
buildType: [ Release ]
runs-on: ${{ matrix.os }}

steps:
Expand All @@ -28,11 +64,13 @@ jobs:
ls
mkdir ${{github.workspace}}/build-${{matrix.buildType}}

- uses: actions-ecosystem/action-get-latest-tag@v1
id: get-latest-tag
- name: Configure CMake (Win)
if: ${{ contains(matrix.os, 'windows') }}
run: cmake -B ${{github.workspace}}/build-${{matrix.buildType}} -DCMAKE_BUILD_TYPE=${{matrix.buildType}} -DDXFCXX_VERSION="${{needs.get_version.outputs.version}}" -DDXFCXX_PACKAGE_SUFFIX="-${{matrix.buildType}}"

- name: Configure CMake
run: cmake -B ${{github.workspace}}/build-${{matrix.buildType}} -DCMAKE_BUILD_TYPE=${{matrix.buildType}} -DDXFCXX_VERSION=${{steps.get-latest-tag.outputs.tag}} -DDXFCXX_PACKAGE_SUFFIX=-${{matrix.buildType}}
- name: Configure CMake (!Win)
if: ${{ !contains(matrix.os, 'windows') }}
run: cmake -B ${{github.workspace}}/build-${{matrix.buildType}} -DCMAKE_BUILD_TYPE=${{matrix.buildType}} -DDXFCXX_VERSION=${{needs.get_version.outputs.version}} -DDXFCXX_PACKAGE_SUFFIX=-${{matrix.buildType}}

- name: Build
run: cmake --build ${{github.workspace}}/build-${{matrix.buildType}} --config ${{matrix.buildType}}
Expand All @@ -44,13 +82,16 @@ jobs:
- name: Upload
uses: actions/upload-artifact@v3
with:
name: dxFeedGraalCxxApi
name: artifacts
path: build-${{matrix.buildType}}/*.zip

publish_release:
if: ${{ inputs.publish || contains(github.event_name, 'push')}}
runs-on: ubuntu-latest
name: Publish Release
needs: [build_package_and_upload]
needs: [get_version, build_package_and_upload]
permissions:
contents: write
steps:
- uses: actions/checkout@v3

Expand All @@ -60,4 +101,13 @@ jobs:
run: echo ${{steps.download.outputs.download-path}}

- name: Display structure of downloaded files
run: ls -R
run: ls -R
- uses: softprops/action-gh-release@v1
with:
files: |
artifacts/*.zip
prerelease: ${{ contains(needs.get_version.outputs.version, 'alpha') || contains(needs.get_version.outputs.version, 'beta') || contains(needs.get_version.outputs.version, 'pre') }}
tag_name: ${{ needs.get_version.outputs.tag_name }}
name: ${{ needs.get_version.outputs.version }}
draft: ${{ contains(needs.get_version.outputs.version, 'draft') }}