Skip to content
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
48 changes: 31 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ env:
MAIN_PYTHON_VERSION: "3.10"
PACKAGE_NAME: "ansys.api.additive"
DEFINITION_VERSION: "v0"
DOTNET_VERSION: "6.0.x"

jobs:
build:
Expand Down Expand Up @@ -57,21 +58,34 @@ jobs:
path: dist/
retention-days: 7

nuget:
name: Build nuget package
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Setup dotnet
uses: actions/setup-dotnet@v1
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x
dotnet-version: ${{ env.DOTNET_VERSION }}

# Publish
- name: Build nuget package
run: |
dotnet nuget add source --username ${{ github.actor }} --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/ansys-internal/index.json"
version=$(find . -name VERSION -exec cat "{}" \;)
rm -rf nuget_package
dotnet pack csharp/Ansys.Api.Additive.csproj -c Release -o nuget_package -p:PackageVersion=${version}
dotnet pack csharp/Ansys.Api.Additive.csproj -c Release -o nuget_package -p:Version=${version}
- name: Upload package artifact
uses: actions/upload-artifact@v3
with:
name: ansys-api-additive-packages
path: nuget_package/
retention-days: 7

release:
if: github.event_name == 'push' && contains(github.ref, 'refs/tags')
needs: [build]
needs: [build, nuget]
runs-on: ubuntu-latest
steps:
- name: Set up Python
Expand Down Expand Up @@ -105,6 +119,7 @@ jobs:
TWINE_PASSWORD: ${{ secrets.PYANSYS_PYPI_PRIVATE_PAT }}
TWINE_REPOSITORY_URL: https://pkgs.dev.azure.com/pyansys/_packaging/pyansys/pypi/upload


- name: Release
uses: softprops/action-gh-release@v1
with:
Expand All @@ -113,24 +128,23 @@ jobs:
./**/*.whl
./**/*.tar.gz
./**/*.pdf
./**/*.nupkg

nuget:
publish-nuget-package:
if: github.event_name == 'push' && contains(github.ref, 'refs/tags')
name: Publish nuget package
needs: [nuget]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Setup dotnet
uses: actions/setup-dotnet@v1
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x
dotnet-version: ${{ env.DOTNET_VERSION }}

# Publish
- name: Build and publish nuget package
- uses: actions/download-artifact@v3

- name: Display structure of downloaded files
run: ls -R

- name: Publish nuget package
run: |
dotnet nuget add source --username ${{ github.actor }} --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/ansys-internal/index.json"
version=$(find . -name VERSION -exec cat "{}" \;)
rm -rf nuget_package
dotnet pack csharp/Ansys.Api.Additive.csproj -c Release -o nuget_package -p:PackageVersion=${version}
dotnet nuget push nuget_package/*.nupkg --source github
dotnet nuget push ./**/*.nupkg --source github
2 changes: 1 addition & 1 deletion ansys/api/additive/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.2.3
1.2.4
1 change: 1 addition & 0 deletions csharp/Ansys.Api.Additive.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<AssemblyName>Ansys.Api.Additive</AssemblyName>
<Authors>Additive Developers</Authors>
<Company>Ansys Inc.</Company>
<Copyright>(c) 2023, Ansys Inc.</Copyright>
<PackageDescription>Protobuf definitions for Additive API</PackageDescription>
<RepositoryUrl>https://github.com/ansys/ansys-api-additive</RepositoryUrl>
</PropertyGroup>
Expand Down