Skip to content

Commit

Permalink
Initial commit.
Browse files Browse the repository at this point in the history
  • Loading branch information
ShikiSuen committed Apr 23, 2024
0 parents commit b308a2c
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/update_enka_db.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Update EnkaDB Assets

on:
workflow_dispatch: {}
schedule:
- cron: '0 12 * * *'

jobs:
update:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20

- name: Fetch latest commit SHA
id: latest_sha
run: echo "::set-output name=sha::$(git ls-remote https://github.com/EnkaNetwork/API-docs.git HEAD | cut -f1)"

- name: Install QuickType
id: install_quicktype
run: npm install -g quicktype

- name: Run update asset meta script
id: compare_shas
run: make

- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: update-enka-asset-${{ github.run_number }}
base: main
title: "Update EnkaDB Assets"
body: |
This PR updates the EnkaDB Asset JSON files.
delete-branch: true
assignees: CanglongCl
reviewers: CanglongCl
team-reviewers: |
owners
maintainers
11 changes: 11 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
SHELL := /bin/sh
.PHONY: build

build:
rm -rf /var/tmp/temporaryJSON4Enka/ || true
mkdir /var/tmp/temporaryJSON4Enka/
git clone https://github.com/EnkaNetwork/API-docs.git /var/tmp/temporaryJSON4Enka/
cp -r /var/tmp/temporaryJSON4Enka/store ./
rm -rf /var/tmp/temporaryJSON4Enka/
export PATH=${PATH}:$(pwd) && CWD=$(pwd) && find . -name '*.json' -exec quicktype --lang swift {} --out {}.swift \;
find . -name '*.json' -exec rm {} \;
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# EnkaDBStructMonitor

This repo is for tracking Swift Struct changes from Enka-API-Docs repository.

0 comments on commit b308a2c

Please sign in to comment.