Skip to content

Add IpfConnection

Add IpfConnection #105

Workflow file for this run

name: "Build & Test & Release"
on:
push:
pull_request:
workflow_dispatch:
jobs:
build_and_test:
name: Build & Test on ${{ matrix.OS_NAME }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: windows-latest
OS_NAME: win-x64
- os: ubuntu-latest
OS_NAME: linux-x64
- os: macos-latest
OS_NAME: osx-x64
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
6.0.x
- name: Restore Dependencies
run: dotnet restore
- name: Build Project
run: dotnet build -c Release --no-restore
- name: Test Project
run: dotnet test --configuration Release --no-build --verbosity normal --logger:"console;verbosity=normal"
- name: Pack Project
run: dotnet pack -c Release
release:
needs: build_and_test
if: (startsWith(github.event.ref, 'refs/tags/'))
name: Release
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
6.0.x
- name: Publish Tools
run: |
./publish.sh DxFeed.Graal.Net.Tools
./publish.sh DxFeed.Graal.Net.Tools win-x64
./publish.sh DxFeed.Graal.Net.Tools linux-x64
./publish.sh DxFeed.Graal.Net.Tools osx-x64
codesign -f -s - artifacts/Publish/osx-x64/DxFeed.Graal.Net.Tools/DxFeed.Graal.Net.Tools
./publish.sh DxFeed.Graal.Net.Tools osx-arm64
codesign -f -s - artifacts/Publish/osx-arm64/DxFeed.Graal.Net.Tools/DxFeed.Graal.Net.Tools
(cd artifacts/Publish/DxFeed.Graal.Net.Tools/ && zip DxFeed.Graal.Net.Tools-framework-dependent-${{ github.ref_name }}.zip . -r -D)
(cd artifacts/Publish/win-x64/DxFeed.Graal.Net.Tools/ && zip DxFeed.Graal.Net.Tools-self-contained-win-x64-${{ github.ref_name }}.zip . -r -D)
(cd artifacts/Publish/linux-x64/DxFeed.Graal.Net.Tools/ && zip DxFeed.Graal.Net.Tools-self-contained-linux-x64-${{ github.ref_name }}.zip . -r -D)
(cd artifacts/Publish/osx-x64/DxFeed.Graal.Net.Tools/ && zip DxFeed.Graal.Net.Tools-self-contained-osx-x64-${{ github.ref_name }}.zip . -r -D)
(cd artifacts/Publish/osx-arm64/DxFeed.Graal.Net.Tools/ && zip DxFeed.Graal.Net.Tools-self-contained-osx-arm64-${{ github.ref_name }}.zip . -r -D)
shell: bash
- name: Upload Tools
uses: softprops/action-gh-release@v1
with:
generate_release_notes: true
files: |
artifacts/Publish/DxFeed.Graal.Net.Tools/DxFeed.Graal.Net.Tools-framework-dependent-${{ github.ref_name }}.zip
artifacts/Publish/linux-x64/DxFeed.Graal.Net.Tools/DxFeed.Graal.Net.Tools-self-contained-linux-x64-${{ github.ref_name }}.zip
artifacts/Publish/osx-arm64/DxFeed.Graal.Net.Tools/DxFeed.Graal.Net.Tools-self-contained-osx-arm64-${{ github.ref_name }}.zip
artifacts/Publish/osx-x64/DxFeed.Graal.Net.Tools/DxFeed.Graal.Net.Tools-self-contained-osx-x64-${{ github.ref_name }}.zip
artifacts/Publish/win-x64/DxFeed.Graal.Net.Tools/DxFeed.Graal.Net.Tools-self-contained-win-x64-${{ github.ref_name }}.zip
token: ${{ secrets.GITHUB_TOKEN }}
- name: Pack NuGet
run: dotnet pack -c Release --property:PackageOutputPath=${{ github.workspace }}/artifacts/Packages
- name: Upload NuGet
run: |
nuget push artifacts/Packages/DxFeed.Graal.Net.${{ github.ref_name }}.nupkg \
-Source ${{ secrets.JFROG_PATH }}/${{ github.ref_name }} \
-ApiKey ${{ secrets.JFROG_API_KEY }}
shell: bash
build_and_upload_docs:
needs: release
if: (startsWith(github.event.ref, 'refs/tags/'))
name: Build & Upload Docs
runs-on: windows-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
6.0.x
- name: Restore Dependencies
run: dotnet restore
- name: Build Project
run: dotnet build -c Release --no-restore
- name: Install DocFX
run: dotnet tool update -g docfx
- name: Prepare Tag
id: prepare_tag
if: startsWith(github.ref, 'refs/tags/')
run: |
echo "DEPLOY_TAG_NAME=deploy-${TAG_NAME}" >> "${GITHUB_OUTPUT}"
- name: Build Doc
run: ./build_doc.cmd
- name: Upload Doc
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: artifacts/Documentation
tag_name: ${{ steps.prepare_tag.outputs.DEPLOY_TAG_NAME }}
commit_message: 'deploy: ${{ github.ref_name }}'
allow_empty_commit: true
# ToDo Create a reusable workflow and extract uploading artifacts to a separate flow.
# - name: Upload DxFeed.Graal.Net.Tools
# if: github.event_name == 'workflow_dispatch'
# uses: actions/upload-artifact@v3
# with:
# name: DxFeed.Graal.Net.Tools-self-contained-${{ matrix.OS_NAME }}
# path: |
# artifacts/Publish/${{ matrix.OS_NAME }}/
#
# - name: Upload DxFeed.Graal.Net.Tools for macOS Apple Silicon
# if: github.event_name == 'workflow_dispatch' && matrix.os == 'macOS-latest'
# uses: actions/upload-artifact@v3
# with:
# name: DxFeed.Graal.Net.Tools-self-contained-osx-arm64
# path: |
# artifacts/Publish/osx-arm64