chore: Replace personal access token with GitHub App Token (#66) #80
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: Tested and Published on NuGet | |
| on: | |
| push: | |
| branches: [ master ] | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-22.04 | |
| steps: | |
| - name: Checkout OpenActive.NET | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # avoid shallow clone so nbgv can do its work. | |
| - name: Get current version | |
| uses: dotnet/nbgv@master | |
| id: nbgv | |
| - name: Setup .NET Core 3.1.x | |
| uses: actions/setup-dotnet@v1 | |
| with: | |
| dotnet-version: 3.1.x | |
| - name: Install dependencies | |
| run: dotnet restore | |
| - name: Test | |
| run: dotnet test ./OpenActive.NET.Test/OpenActive.NET.Test.csproj --configuration Release --no-restore --verbosity normal | |
| - name: Build | |
| run: dotnet build ./OpenActive.NET/OpenActive.NET.csproj --configuration Release --no-restore | |
| - name: Pack | |
| run: dotnet pack ./OpenActive.NET/OpenActive.NET.csproj --configuration Release --include-source --no-build -p:IncludeSymbols=true -p:SymbolPackageFormat=snupkg | |
| - name: Push to Nuget | |
| if: "! contains(toJSON(github.event.commits.*.message), '[no-release]')" | |
| run: dotnet nuget push "./OpenActive.NET/**/*.nupkg" -k ${{secrets.NUGET_API_KEY}} --skip-duplicate -s https://api.nuget.org/v3/index.json | |
| - name: Create Release | |
| if: "! contains(toJSON(github.event.commits.*.message), '[no-release]')" | |
| id: create_release | |
| uses: actions/create-release@v1 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| with: | |
| tag_name: v${{ steps.nbgv.outputs.SimpleVersion }} | |
| release_name: Release ${{ steps.nbgv.outputs.SimpleVersion }} | |
| body: | | |
| This release contains minor amendments based on updates to the [OpenActive Vocabulary](https://openactive.io/ns/) (codified by the [Data Models](https://github.com/openactive/data-models)), [Test Interface](https://openactive.io/test-interface/) and/or [Beta Namespace](https://openactive.io/ns-beta/). | |
| Published to [Nuget](https://www.nuget.org/packages/OpenActive.NET/${{ steps.nbgv.outputs.SimpleVersion }}). | |
| draft: false | |
| prerelease: false | |
| sleep: | |
| needs: publish | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Sleep for 10 minutes to wait for NuGet to update | |
| uses: whatnick/wait-action@v0.1.2 | |
| with: | |
| time: '10m' | |
| dispatch: | |
| needs: sleep | |
| strategy: | |
| matrix: | |
| repo: ['OpenActive.DatasetSite.NET'] | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Generate GitHub App Token | |
| uses: actions/create-github-app-token@v1 | |
| id: generate-token | |
| with: | |
| app-id: ${{ secrets.GH_APP_ID }} | |
| private-key: ${{ secrets.GH_APP_PRIVATE_KEY }} | |
| - name: Trigger tooling update | |
| uses: peter-evans/repository-dispatch@v3 | |
| with: | |
| token: ${{ steps.generate-token.outputs.token }} | |
| repository: openactive/${{ matrix.repo }} | |
| event-type: OpenActive.NET-update |