OpenActive.NET-update #87
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: Update Data Model and Template | |
| on: | |
| workflow_dispatch: | |
| repository_dispatch: | |
| types: [OpenActive.NET-update,data-models-update,dataset-site-template-update] | |
| jobs: | |
| generate: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout OpenActive.DatasetSite.NET | |
| uses: actions/checkout@v2 | |
| with: | |
| ref: master | |
| - name: Setup Node.js 14.x | |
| uses: actions/setup-node@v1 | |
| with: | |
| node-version: 14.x | |
| - name: Setup .NET 6.0.x | |
| uses: actions/setup-dotnet@v2 | |
| with: | |
| dotnet-version: 6.0.x | |
| - name: Install OpenActive.DatasetSite.NET.Generator | |
| run: npm install | |
| working-directory: ./OpenActive.DatasetSite.NET.Generator/ | |
| - name: Update OpenActive.DatasetSite.NET.Generator with latest data-models and dataset-site-template | |
| run: npm install @openactive/data-models@latest @openactive/dataset-site-template@latest | |
| working-directory: ./OpenActive.DatasetSite.NET.Generator/ | |
| - name: Run .NET dataset site generator | |
| run: npm start | |
| working-directory: ./OpenActive.DatasetSite.NET.Generator/ | |
| - name: Update OpenActive.NET to latest version | |
| run: dotnet add package OpenActive.NET | |
| working-directory: ./OpenActive.DatasetSite.NET/ | |
| - name: git stash if material changes have not been made | |
| # When considering whether it's worth making a PR, ignore the following: | |
| # - Any updates to the package.json or package-lock.json files in OpenActive.DatasetSite.NET.Generator (not worth creating a PR JUST for these if the template itself has not been updated) | |
| # git stashing if no material changes allows the next step to close the PR if one is already open | |
| run: if [ "$(git diff --numstat | grep -vc '^.*package\.json\|.*package-lock\.json$')" -eq "0" ]; then git stash; else echo "Material changes found"; fi | |
| working-directory: ./ | |
| - name: Create Pull Request | |
| id: cpr | |
| uses: peter-evans/create-pull-request@v4 | |
| with: | |
| path: . | |
| token: ${{ secrets.PUBLIC_REPO_ACCESS_TOKEN }} | |
| commit-message: Update data models and dataset site template | |
| committer: openactive-bot <[email protected]> | |
| author: openactive-bot <[email protected]> | |
| signoff: false | |
| branch: ci/update-data-models | |
| delete-branch: true | |
| title: 'Update data models and dataset site template' | |
| body: | | |
| Update to use latest version of data models based on the [OpenActive Vocabulary](https://openactive.io/ns/) (codified by the [Data Models](https://github.com/openactive/data-models)), and the latest version of the [Dataset Site Template](https://github.com/openactive/dataset-site-template) | |
| labels: | | |
| automated pr | |
| draft: false | |
| - name: Check outputs | |
| run: | | |
| echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}" | |
| echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}" |