-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create deployment-and-validation.yml
- Loading branch information
1 parent
ea80eb7
commit 59c3862
Showing
1 changed file
with
70 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,70 @@ | ||
name: Merge natives, validate and create a release | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
run-merge-and-release: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.x' | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install jsonschema | ||
- name: Run merge.py | ||
run: | | ||
python merge.py | ||
- name: Validate JSON | ||
uses: docker://orrosenblatt/validate-json-action:latest | ||
env: | ||
INPUT_SCHEMA: ./schema.json | ||
INPUT_JSONS: ./rdr3natives.json | ||
|
||
- name: Commit and push changes | ||
if: success() | ||
run: | | ||
git config --global user.name "github-actions[bot]" | ||
git config --global user.email "github-actions[bot]@users.noreply.github.com" | ||
git add rdr3natives.json | ||
git commit -m "Update rdr3natives.json with new data" | ||
git push origin HEAD:main | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Create Release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ github.sha }} | ||
release_name: Release ${{ github.sha }} | ||
draft: false | ||
prerelease: false | ||
generate_release_notes: true | ||
|
||
- name: Upload rdr3natives.json to Release | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: ./rdr3natives.json | ||
asset_name: rdr3natives.json | ||
asset_content_type: application/json |