Skip to content

Commit

Permalink
Update GitHub actions (#30)
Browse files Browse the repository at this point in the history
Update GitHub actions, and add an action that can update the SDK generator automatically once per week.  We'll leave the schedule part disabled for the moment.
  • Loading branch information
tspence authored Aug 13, 2024
1 parent c3ebccb commit 940192b
Show file tree
Hide file tree
Showing 4 changed files with 14,052 additions and 5 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/check-for-updates.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Check for OpenAPI updates

on:
# schedule:
# - cron: "0 0 * * 0" # Run once per week

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup .NET Core @ Latest
uses: actions/setup-dotnet@v4
with:
dotnet-version: "8.0.x"

- name: Add the SDK Generator
run: dotnet tool install SdkGenerator --global

- name: Run dotnet pack
run: SdkGenerator build -p ./sdk-config.json

- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@v6
- name: Check outputs
if: ${{ steps.cpr.outputs.pull-request-number }}
run: |
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"
11 changes: 6 additions & 5 deletions .github/workflows/nuget-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,25 @@ jobs:
name: Update NuGet package
steps:
- name: Checkout repository
uses: actions/checkout@v1
uses: actions/checkout@v4

- name: Setup .NET Core @ Latest
uses: actions/setup-dotnet@v1
uses: actions/setup-dotnet@v4
with:
dotnet-version: "7.0.x"
include-prerelease: false
dotnet-version: "8.0.x"

- name: Build solution and generate NuGet package
run: dotnet build -c Release

- name: Setup Nuget
uses: nuget/setup-nuget@v1
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
uses: nuget/setup-nuget@v2
with:
nuget-api-key: ${{ secrets.NUGET_API_KEY }}
nuget-version: "5.x"

- name: Run Nuget pack
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
run: nuget pack ProjectManagerClient.nuspec

- name: Push generated package to GitHub registry
Expand Down
48 changes: 48 additions & 0 deletions sdk-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"CompanyName": "ProjectManager.com",
"AuthorName": "ProjectManager.com",
"AuthorEmail": "[email protected]",
"ProjectName": "ProjectManager API",
"CopyrightHolder": "ProjectManager.com, Inc.",
"ProjectStartYear": 2023,
"SwaggerUrl": "https://api.projectmanager.com/api/swagger/ProjectManager.com,%20Inc%20API/swagger.json",
"Environments": [
{
"Name": "production",
"Url": "https://api.projectmanager.com",
"Default": null
}
],
"SwaggerSchemaFolder": "swagger",
"GenericSuffixes": [
"AstroResult"
],
"IgnoredParameters": [
{
"Name": "X-Integration-Name",
"Location": "Header"
}
],
"IgnoredEndpoints": [
"Get Task Metadata",
"TaskMetadata.GetTaskMetadata"
],
"SemverMode": 3,
"Keywords": "projectmanager project management task tracking projects tasks",
"Description": "Software development kit for the ProjectManager.com API.",
"AuthenticationHelp": "",
"ReleaseNotes": "https://learn.projectmanager.com/latest-releases",
"VersionNumberUrl": "https://api.projectmanager.com/api/swagger/ProjectManager.com,%20Inc%20API/swagger.json",
"VersionNumberRegex": "version\": \"(.*)\"",
"CSharp": {
"ModuleName": "ProjectManager.SDK",
"ClassName": "ProjectManagerClient",
"ResponseClass": "AstroResult",
"Namespace": "ProjectManager.SDK",
"GithubUrl": "https://github.com/projectmgr/projectmanager-sdk-csharp",
"HandwrittenClasses": [
"AstroResult",
"AstroError"
]
}
}
Loading

0 comments on commit 940192b

Please sign in to comment.