|
1 | 1 | name: Create Schema for latest release
|
2 | 2 |
|
3 | 3 | on:
|
4 |
| - repository_dispatch: |
5 |
| - types: [create_schema] |
6 |
| - workflow_dispatch: |
| 4 | + release: |
| 5 | + types: [published] |
7 | 6 |
|
8 | 7 | jobs:
|
| 8 | + determine_whether_to_run: |
| 9 | + runs-on: ubuntu-latest |
| 10 | + outputs: |
| 11 | + update_schema: ${{ steps.check-update-schema.outputs.run_jobs }} |
| 12 | + |
| 13 | + steps: |
| 14 | + - name: Check if event should be sent |
| 15 | + id: check-update-schema |
| 16 | + run: (echo "${{ github.ref }}" | grep -Eq '^refs\/tags\/[0-9]+\.[0-9]+\.[0-9]+$') && echo "::set-output name=run_jobs::true" || echo "::set-output name=run_jobs::false" |
9 | 17 | create_schema:
|
10 | 18 | runs-on: ubuntu-latest
|
| 19 | + needs: determine_whether_to_run |
| 20 | + if: needs.determine_whether_to_run.outputs.update_schema == 'true' |
11 | 21 | name: Create Schema
|
12 | 22 |
|
13 | 23 | steps:
|
14 | 24 | - name: Checkout noss Repo
|
15 | 25 | uses: actions/checkout@v3
|
16 |
| - with: |
17 |
| - path: noss |
18 |
| - |
19 |
| - - name: Checkout oss repo |
20 |
| - uses: actions/checkout@v3 |
21 |
| - with: |
22 |
| - repository: appbaseio/reactivesearch-api |
23 |
| - path: oss |
24 |
| - token: ${{ secrets.REPO_ACCESS_TOKEN }} |
25 | 26 |
|
26 | 27 | - name: Make clean and build
|
27 | 28 | run: make clean && make
|
28 |
| - working-directory: ./noss |
29 | 29 |
|
30 | 30 | - name: Generate the latest schema
|
31 | 31 | run: ./build/reactivesearch --create-schema
|
32 |
| - working-directory: ./noss |
33 |
| - |
34 |
| - - name: Remove older schema |
35 |
| - run: rm schema -rf |
36 |
| - working-directory: ./oss |
37 |
| - |
38 |
| - - name: Copy the built schema to oss |
39 |
| - run: cp -r noss/schema oss/ |
40 | 32 |
|
41 | 33 | - name: Add and Commit changes
|
42 | 34 | uses: EndBug/add-and-commit@v9
|
|
45 | 37 | default_author: github_actions
|
46 | 38 | message: Update schema for latest release
|
47 | 39 | push: true
|
48 |
| - cwd: ./oss |
0 commit comments