Bump Xero API version to 10.1.0 #537
This file contains hidden or 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
| name: LS manglement and generation | |
| on: | |
| push: | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| env: | |
| ContinuousIntegrationBuild: true | |
| EmbedUntrackedSources: true | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v1 | |
| - uses: actions/setup-dotnet@v1 | |
| - name: Setup NuGet | |
| run: dotnet nuget add source "https://pkgs.dev.azure.com/ledgerscope/_packaging/LSFeed/nuget/v3/index.json" --name LSFeed -u ledgerscope --password ${{ secrets.LEDGERSCOPEDEVOPS }} --store-password-in-clear-text | |
| - run: dotnet new tool-manifest | |
| - name: Install Ledgerscope YamlMangl | |
| run: dotnet tool install Ledgerscope.YamlMangl | |
| - name: First merge, generating xero_accounting_output.yaml | |
| run: | | |
| dotnet yamlmangl merge -input ./xero_accounting.yaml -delta ./xero_accounting_delta.yaml -output ./xero_accounting_output.yaml -headerType full | |
| if [ $? -ne 0 ]; then | |
| echo "YamlMangl first merge failed with exit code $?" | |
| exit 1 | |
| fi | |
| - name: Second merge, generating xero_accounting_ls_output.yaml | |
| run: | | |
| dotnet yamlmangl merge -input ./xero_accounting_output.yaml -delta ./xero_accounting_ls_delta.yaml -output ./xero_accounting_ls_output.yaml -headerType full | |
| if [ $? -ne 0 ]; then | |
| echo "YamlMangl second merge failed with exit code $?" | |
| exit 1 | |
| fi | |
| - name: Generate dev copy of xero_accounting_ls_output.yaml | |
| run: sed 's|/xero.api.ledgerscope.com/|/xero.api.ledgerscope.dev/|g' ./xero_accounting_ls_output.yaml > ./xero_accounting_ls_output_dev.yaml | |
| - name: Generate localhost copy of xero_accounting_ls_output.yaml | |
| run: sed 's|/xero.api.ledgerscope.com/|/docs.localhost:44363/|g' ./xero_accounting_ls_output.yaml > ./xero_accounting_ls_output_localhost.yaml | |
| - name: Setup NuGet | |
| run: dotnet nuget add source --username ${{ github.repository_owner }} --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" | |
| - name: Show the OpenAPI version | |
| uses: docker://openapitools/openapi-generator-cli:v4.3.1 | |
| with: | |
| args: version | |
| - name: generate csharp Assets | |
| uses: docker://openapitools/openapi-generator-cli:v4.3.1 | |
| with: | |
| args: generate -t ./generator/modules/csharp-netcore -i ./xero_assets.yaml -g csharp-netcore -o ./output/csharp-netcore/accounting --additional-properties=packageVersion=4.0.${{github.run_number}} -c ./generator/scripts/csharp/config.yml --model-package Model.Asset | |
| - name: generate csharp Bankfeeds | |
| uses: docker://openapitools/openapi-generator-cli:v4.3.1 | |
| with: | |
| args: generate -t ./generator/modules/csharp-netcore -i ./xero_bankfeeds.yaml -g csharp-netcore -o ./output/csharp-netcore/accounting --additional-properties=packageVersion=4.0.${{github.run_number}} -c ./generator/scripts/csharp/config.yml --model-package Model.Bankfeeds | |
| - name: generate csharp Files | |
| uses: docker://openapitools/openapi-generator-cli:v4.3.1 | |
| with: | |
| args: generate -t ./generator/modules/csharp-netcore -i ./xero_files.yaml -g csharp-netcore -o ./output/csharp-netcore/accounting --additional-properties=packageVersion=4.0.${{github.run_number}} -c ./generator/scripts/csharp/config.yml --model-package Model.Files | |
| - name: generate csharp Identity | |
| uses: docker://openapitools/openapi-generator-cli:v4.3.1 | |
| with: | |
| args: generate -t ./generator/modules/csharp-netcore -i ./xero-identity.yaml -g csharp-netcore -o ./output/csharp-netcore/accounting --additional-properties=packageVersion=4.0.${{github.run_number}} -c ./generator/scripts/csharp/config.yml --model-package Model.Identity | |
| - name: generate csharp Projects | |
| uses: docker://openapitools/openapi-generator-cli:v4.3.1 | |
| with: | |
| args: generate -t ./generator/modules/csharp-netcore -i ./xero-projects.yaml -g csharp-netcore -o ./output/csharp-netcore/accounting --additional-properties=packageVersion=4.0.${{github.run_number}} -c ./generator/scripts/csharp/config.yml --model-package Model.Project | |
| - name: generate csharp Accounting | |
| uses: docker://openapitools/openapi-generator-cli:v4.3.1 | |
| with: | |
| args: generate -t ./generator/modules/csharp-netcore -i ./xero_accounting_output.yaml -g csharp-netcore -o ./output/csharp-netcore/accounting --additional-properties=packageVersion=4.0.${{github.run_number}} -c ./generator/scripts/csharp/config.yml --model-package Model.Accounting | |
| - name: Update permissions | |
| run: sudo chmod 777 -R . | |
| - name: Copy additional code files | |
| run: cp -r ./src ./output/csharp-netcore/accounting/src/Xero.NetStandard.OAuth2/ | |
| - name: Install dependencies | |
| run: dotnet restore | |
| working-directory: ./output/csharp-netcore/accounting | |
| - name: Build the code from the csharp files we just generated | |
| run: dotnet build --configuration Release --no-restore -p:Version=4.0.${{github.run_number}} | |
| working-directory: ./output/csharp-netcore/accounting | |
| - name: Run unit tests | |
| run: dotnet test --no-restore --verbosity normal | |
| working-directory: ./output/csharp-netcore/accounting | |
| - name: Package | |
| run: | | |
| dotnet pack \ | |
| -p:PackageId="Ledgerscope.Xero.NetStandard.OAuth2" \ | |
| -p:PackageVersion=4.0.${{github.run_number}} \ | |
| -p:RepositoryUrl="https://github.com/ledgerscope/Xero-OpenAPI" \ | |
| -p:RepositoryType=git \ | |
| -p:Authors="Ledgerscope Services Limited" \ | |
| -p:Description="This is a Ledgerscope modification of the Xero .NETStandard SDK library used to communicate with the Xero API using OAuth2.0. See https://github.com/ledgerscope/Xero-OpenAPI for more information" \ | |
| -p:PackageProjectUrl="https://github.com/ledgerscope/Xero-OpenAPI" | |
| working-directory: ./output/csharp-netcore/accounting/src/Xero.NetStandard.OAuth2/ | |
| - uses: actions/upload-artifact@v4 | |
| if: success() | |
| with: | |
| name: Packages | |
| path: ./**/*.nupkg | |
| - uses: actions/upload-artifact@v4 | |
| if: always() | |
| with: | |
| name: Source | |
| path: ./* | |
| publish-yaml: | |
| runs-on: ubuntu-latest | |
| needs: build | |
| permissions: | |
| id-token: write | |
| contents: read | |
| steps: | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: Source | |
| - name: Az CLI login | |
| uses: azure/login@v1 | |
| with: | |
| client-id: ${{ secrets.AZURE_CLIENT_ID }} | |
| tenant-id: ${{ secrets.AZURE_TENANT_ID }} | |
| subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} | |
| - name: Confirm Az login | |
| run: | | |
| az account show | |
| az group list | |
| - name: Upload xero_accounting_ls_output.yaml to Azure Blob Storage (staging) | |
| run: az storage blob upload --account-name lfidocsstaging --container-name 'yaml' --file ./xero_accounting_ls_output.yaml --name api-explorer/xero_accounting_ls_output.yaml --auth-mode login --overwrite | |
| - name: Upload xero_accounting_ls_output_dev.yaml to Azure Blob Storage (staging) | |
| run: az storage blob upload --account-name lfidocsstaging --container-name 'yaml' --file ./xero_accounting_ls_output_dev.yaml --name api-explorer/xero_accounting_ls_output_dev.yaml --auth-mode login --overwrite | |
| - name: Upload xero_accounting_ls_output_localhost.yaml to Azure Blob Storage (staging) | |
| run: az storage blob upload --account-name lfidocsstaging --container-name 'yaml' --file ./xero_accounting_ls_output_localhost.yaml --name api-explorer/xero_accounting_ls_output_localhost.yaml --auth-mode login --overwrite | |
| - name: Upload xero_accounting_ls_output.yaml to Azure Blob Storage (production) | |
| run: az storage blob upload --account-name lfidocsprod --container-name 'yaml' --file ./xero_accounting_ls_output.yaml --name api-explorer/xero_accounting_ls_output.yaml --auth-mode login --overwrite | |
| - name: Upload xero_accounting_ls_output_dev.yaml to Azure Blob Storage (production) | |
| run: az storage blob upload --account-name lfidocsprod --container-name 'yaml' --file ./xero_accounting_ls_output_dev.yaml --name api-explorer/xero_accounting_ls_output_dev.yaml --auth-mode login --overwrite | |
| - name: Upload xero_accounting_ls_output_localhost.yaml to Azure Blob Storage (production) | |
| run: az storage blob upload --account-name lfidocsprod --container-name 'yaml' --file ./xero_accounting_ls_output_localhost.yaml --name api-explorer/xero_accounting_ls_output_localhost.yaml --auth-mode login --overwrite | |
| publish-nuget: | |
| runs-on: ubuntu-latest | |
| needs: build | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| name: Packages | |
| - name: Setup NuGet | |
| run: dotnet nuget add source --username ${{ github.repository_owner }} --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" | |
| - name: Publish | |
| run: dotnet nuget push -s github "**/*.nupkg" | |
| working-directory: ./output/csharp-netcore/accounting |