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

generateclasses.yaml can use the NuGet package of JNetReflector side by side with code or published version #821

Merged
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
34 changes: 32 additions & 2 deletions .github/workflows/generateclasses.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,13 @@ on:
required: true
default: false
type: boolean
UseLastRepositoryBuild:
description: 'Use latest NuGet packages from JNet'
required: true
default: false
type: boolean
UseLatestJNetReflector:
description: 'Shall use latest unpublished version of JNetReflector'
description: 'Shall use latest unpublished code of JNetReflector'
required: true
default: false
type: boolean
Expand Down Expand Up @@ -86,6 +91,27 @@ jobs:
- name: Clear Java generated files
run: Remove-Item .\src\jvm\knet\src\main\java\org\mases\knet\generated\* -Recurse -Force -Exclude README.md

- name: Get last workflow run of JNet
if: ${{ inputs.UseLastRepositoryBuild == true }}
shell: bash
run: echo "JNET_LAST_RUN=$(curl -sL https://api.github.com/repos/masesgroup/JNet/actions/workflows/build.yaml/runs | jq -r '.workflow_runs[0].id?')" >> $GITHUB_ENV

- name: Download artifact
if: ${{ inputs.UseLastRepositoryBuild == true }}
run: gh run download ${{ env.JNET_LAST_RUN }} --name JNetNuGet --repo masesgroup/JNet --dir JNetNuGet
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: List NuGet packages downloaded
if: ${{ inputs.UseLastRepositoryBuild == true }}
continue-on-error: true
shell: cmd
run: dir .\JNetNuGet\*nupkg

- name: Add local repo
if: ${{ success() && inputs.UseLastRepositoryBuild == true }}
run: dotnet nuget add source --name local "${{ github.workspace }}\JNetNuGet\"

- name: Prebuild JNetReflector
if: ${{ inputs.UseLatestJNetReflector == true }}
run: dotnet build --no-incremental --configuration Release JNet\src\net\JNetReflector\JNetReflector.csproj
Expand All @@ -102,9 +128,13 @@ jobs:
if: ${{ inputs.UseLatestJNetReflector == true }}
run: dotnet build --no-incremental --configuration Release JNet\src\net\JNetReflector\JNetReflector.csproj

- name: Use latest unpublished NuGet of JNetReflector
if: ${{ inputs.UseLastRepositoryBuild == true && inputs.UseLatestJNetReflector == false }}
run: dotnet tool update -g MASES.JNetReflector

- name: Download latest published version of JNetReflector
run: dotnet tool update --version 2.5.11 -g MASES.JNetReflector
if: ${{ inputs.UseLatestJNetReflector == false }}
run: dotnet tool update --version 2.5.11 -g MASES.JNetReflector

- name: Build classes with unpublished JNetReflector
if: ${{ inputs.UseLatestJNetReflector == true }}
Expand Down
Loading