-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #147 from ror-community/v2-actions
update actions for v2
- Loading branch information
Showing
8 changed files
with
150 additions
and
53 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,13 @@ name: Create data dump | |
on: | ||
workflow_dispatch: | ||
inputs: | ||
schema-version: | ||
required: true | ||
description: Release schema version | ||
type: choice | ||
options: | ||
- v1 | ||
- v2 | ||
new-release: | ||
type: string | ||
description: Name of the directory that the new release is located in | ||
|
@@ -25,7 +32,7 @@ jobs: | |
- name: checkout ror data repo | ||
uses: actions/checkout@v2 | ||
with: | ||
repository: ror-community/ror-data | ||
repository: ror-community/ror-data-test | ||
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} | ||
path: ./ror-data | ||
- name: copy previous data dump file | ||
|
@@ -37,6 +44,7 @@ jobs: | |
with: | ||
repository: ror-community/curation_ops | ||
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} | ||
ref: v2-crosswalk | ||
path: ./curation_ops | ||
- name: Set up Python environment | ||
uses: actions/setup-python@v2 | ||
|
@@ -46,7 +54,12 @@ jobs: | |
id: gendumpscript | ||
run: | | ||
cd ./curation_ops/generate_dump/ | ||
python generate_dump.py -r ${{github.event.inputs.new-release}} -e ${{github.event.inputs.prev-release}} -i '../../ror-records' -o '../../ror-records' | ||
if [[ ${{ github.event.inputs.schema-version }} == 'v1' ]]; then | ||
python generate_dump.py -r ${{github.event.inputs.new-release}} -e ${{github.event.inputs.prev-release}} -i '../../ror-records' -o '../../ror-records' -v 1 | ||
fi | ||
if [[ ${{ github.event.inputs.schema-version }} == 'v2' ]]; then | ||
python generate_dump.py -r ${{github.event.inputs.new-release}} -e ${{github.event.inputs.prev-release}} -i '../../ror-records' -o '../../ror-records' -v 2 | ||
fi | ||
- name: cat error file | ||
if: ${{ steps.gendumpscript.outcome != 'success'}} | ||
run: | | ||
|
@@ -61,11 +74,20 @@ jobs: | |
if: ${{ steps.copynewdump.outcome == 'success'}} | ||
run: | | ||
cd ./ror-data | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "GitHub Action" | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "ror-bot" | ||
git add *.zip | ||
git commit -m "add new data dump file" | ||
git push origin main | ||
- name: commit changed files | ||
if: ${{ steps.commitdumpfile.outcome == 'success'}} && ${{ github.event.inputs.schema-version }} == 'v2' | ||
run: | | ||
cd ./ror-records | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "ror-bot" | ||
git add ${{github.event.inputs.new-release}}/v1/ | ||
git commit -m "add generated v1 files" | ||
git push origin main | ||
- name: Notify Slack | ||
if: always() | ||
uses: edge/simple-slack-notify@master | ||
|
@@ -74,4 +96,4 @@ jobs: | |
with: | ||
channel: '#ror-curation-releases' | ||
color: 'good' | ||
text: 'PROD Data dump ${{github.event.inputs.new-release}} generation status: ${{ steps.commitdumpfile.outcome }} Please check: ${env.GITHUB_SERVER_URL}/${env.GITHUB_REPOSITORY}/actions/runs/${env.GITHUB_RUN_ID}' | ||
text: 'PROD Data dump ${{github.event.inputs.new-release}} generation status: ${{ steps.commitdumpfile.outcome }}. Using base version: ${{ github.event.inputs.schema-version }}. Please check: ${env.GITHUB_SERVER_URL}/${env.GITHUB_REPOSITORY}/actions/runs/${env.GITHUB_RUN_ID}' |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.