CI #51
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is a basic workflow to help you get started with Actions | |
name: CI | |
# Controls when the workflow will run | |
on: | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
# This workflow contains a single job called "build" | |
build: | |
# The type of runner that the job will run on | |
runs-on: windows-latest | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
# Set up JDK for the generator app. | |
- name: Set up JDK 17 | |
uses: actions/setup-java@v2 | |
with: | |
java-version: '17' | |
distribution: 'microsoft' | |
java-package: 'jdk' | |
# Get the .NET SDK repo | |
- name: Checkout dotnet-algorand-sdk repo | |
uses: actions/checkout@v3 | |
# Check out the algod oas json | |
- name: Download oas2.json file | |
#run: TEMP DEFER AS LATEST JSON GENERATES ERRORS curl -L https://raw.githubusercontent.com/algorand/go-algorand/rel/stable/daemon/algod/api/algod.oas2.json -o api-generator/dotnet_templates/algod.oas2.json | |
run: curl -L https://raw.githubusercontent.com/algorand/go-algorand/edbc577636e8c75c454818d463daa1aecf5ebdff/daemon/algod/api/algod.oas2.json -o api-generator/dotnet_templates/algod.oas2.json | |
# Generate the transactions model | |
- name: Generate transactions model | |
run: java -jar api-generator\generator-1.0.0-jar-with-dependencies.jar template -s api-generator\dotnet_templates\Transactions.json -t api-generator\dotnet_templates\ -m dotnet-algorand-sdk\Algod\Model\Transactions -p "api-generator\dotnet_templates\transactions_model_config.properties" | |
# Generate the algod model | |
- name: Generate model | |
run: java -jar api-generator\generator-1.0.0-jar-with-dependencies.jar template -s api-generator\dotnet_templates\algod.oas2.json -t api-generator\dotnet_templates -m dotnet-algorand-sdk\Algod\Model\ -p "api-generator\dotnet_templates\algod_model_config.properties" | |
# Generate the algod client | |
- name: Generate algod client | |
run: java -jar api-generator\generator-1.0.0-jar-with-dependencies.jar template -s api-generator\dotnet_templates\algod.oas2.json -t api-generator\dotnet_templates -c dotnet-algorand-sdk\Algod\ -p "api-generator\dotnet_templates\algod_default_config.properties" | |
# Get .NET Core | |
- name: Setup .NET Core | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: 3.1.402 | |
# Ensure Nuget is available | |
- name: Setup Nuget | |
uses: NuGet/[email protected] | |
# Get DocFx | |
- name: Install Docfx | |
uses: crazy-max/[email protected] | |
with: | |
args: install docfx -y | |
# Install dependencies | |
- name: Install dependencies | |
run: dotnet restore | |
# Build dotnetsdk project Release | |
- name: Build Release | |
run: dotnet build dotnet-algorand-sdk --configuration Release --no-restore | |
# Build dotnetsdk project Unity | |
- name: Build Unity | |
run: dotnet build dotnet-algorand-sdk --configuration Unity --no-restore | |
# Move Nugets | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: my-nuget-packages | |
path: | | |
dotnet-algorand-sdk/bin/Release/*.nupkg | |
dotnet-algorand-sdk/bin/Unity/netstandard2.0/*.nupkg | |
# Verify | |
- name: Verify Contents | |
run: dir -Recurse |