From 88a64eb3108c869ef77e920bd9f3d4d755740b05 Mon Sep 17 00:00:00 2001 From: Filip Navara Date: Fri, 31 May 2024 12:48:37 +0200 Subject: [PATCH] Add GitHub Actions --- .github/workflows/build-nuget.yml | 48 +++++++++++++++++++++++++++++++ .gitignore | 1 + 2 files changed, 49 insertions(+) create mode 100644 .github/workflows/build-nuget.yml diff --git a/.github/workflows/build-nuget.yml b/.github/workflows/build-nuget.yml new file mode 100644 index 0000000..e0d3a55 --- /dev/null +++ b/.github/workflows/build-nuget.yml @@ -0,0 +1,48 @@ +name: Build and publish NuGet + +on: workflow_dispatch + +jobs: + build: + runs-on: ubuntu-latest + permissions: + packages: write + contents: read + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Setup .NET + uses: emclient/setup-dotnet@master + with: + channel: "8.0" + - name: Generate OpenAPI specs from Google Discovery API + run: ./generate-openapi.sh + - name: Generate Google.Apis.Kiota.Calendar + run: ./generate-calendar.sh + - name: Generate Google.Apis.Kiota.Drive + run: ./generate-drive.sh + - name: Generate Google.Apis.Kiota.Gmail + run: ./generate-gmail.sh + - name: Generate Google.Apis.Kiota.People + run: ./generate-people.sh + - name: Generate Google.Apis.Kiota.Tasks + run: ./generate-tasks.sh + - name: Build Google.Apis.Kiota.Core + run: dotnet pack src/Google.Apis.Kiota.Core -o .artifacts + - name: Build Google.Apis.Kiota.Calendar + run: dotnet pack src/Google.Apis.Kiota.Calendar -o .artifacts + - name: Build Google.Apis.Kiota.Drive + run: dotnet pack src/Google.Apis.Kiota.Drive -o .artifacts + - name: Build Google.Apis.Kiota.Gmail + run: dotnet pack src/Google.Apis.Kiota.Gmail -o .artifacts + - name: Build Google.Apis.Kiota.People + run: dotnet pack src/Google.Apis.Kiota.People -o .artifacts + - name: Build Google.Apis.Kiota.Tasks + run: dotnet pack src/Google.Apis.Kiota.Tasks -o .artifacts + - name: Publish + env: + token: ${{ secrets.GITHUB_TOKEN }} + run: | + dotnet nuget add source https://nuget.pkg.github.com/emclient/index.json -n github + dotnet nuget push '.artifacts/*.nupkg' -s github --api-key ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore index 1565303..007a889 100644 --- a/.gitignore +++ b/.gitignore @@ -487,3 +487,4 @@ $RECYCLE.BIN/ google-discovery-to-openapi/ Generated *.generated.yaml +.artifacts/