fix: install Python dependencies before generating clients in release… #37
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: Release | |
| on: | |
| push: | |
| branches: [main] | |
| workflow_dispatch: | |
| jobs: | |
| release-please: | |
| name: Release Please | |
| if: github.event_name == 'push' | |
| permissions: | |
| contents: write # Required to update changelog file | |
| pull-requests: write # Required to create release PRs | |
| uses: equinor/ops-actions/.github/workflows/release-please-manifest.yml@c1be86e02c64b0d2db5c2dba532b5580cdce168d # v9.38.0 | |
| build-and-publish: | |
| name: Build and publish | |
| needs: release-please | |
| if: ${{ always() && (github.event_name == 'workflow_dispatch' || needs.release-please.outputs.releases_created == 'true') }} | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read # Required to read the repository contents | |
| packages: write # Required to publish packages to GitHub Packages | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| with: | |
| persist-credentials: false | |
| - name: Set up Python | |
| uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 | |
| with: | |
| python-version: "3.13" | |
| - name: Install Python dependencies | |
| run: pip install -r requirements.txt | |
| - name: Set up .NET | |
| uses: actions/setup-dotnet@c2fa09f4bde5ebb9d1777cf28262a3eb3db3ced7 # v5.2.0 | |
| with: | |
| dotnet-version: "10.x" | |
| - name: Install Kiota | |
| run: dotnet tool install --global Microsoft.OpenApi.Kiota | |
| - name: Generate C# clients | |
| run: python generate_all.py | |
| - name: Build | |
| run: dotnet build src/OsduCsharpClient/OsduCsharpClient.csproj --configuration Release | |
| - name: Pack | |
| run: dotnet pack src/OsduCsharpClient/OsduCsharpClient.csproj --configuration Release --no-build --output nupkgs | |
| - name: Publish to GitHub Packages | |
| run: | | |
| dotnet nuget push nupkgs/*.nupkg \ | |
| --source "https://nuget.pkg.github.com/equinor/index.json" \ | |
| --api-key "${GITHUB_TOKEN}" \ | |
| --skip-duplicate | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |