XCM Global Asset Registry Generation #998
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
name: XCM Global Asset Registry Generation | |
on: | |
push: | |
branches: | |
- main | |
paths: | |
- .github/workflows/deploy.yml | |
- publicEndpoints/*.json | |
- chainParsers/*.js | |
- xcmgar | |
- xcmgarManager.js | |
- xcmgarTool.js | |
schedule: | |
- cron: '30 */8 * * *' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
strategy: | |
matrix: | |
node-version: [17.x] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Use node js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Install dependencies | |
run: npm install | |
- name: Polkadot XCM Global Asset Registry Generation | |
run: node xcmgar registry -r polkadot | |
- name: Kusama XCM Global Asset Registry Generation | |
run: node xcmgar registry -r kusama | |
- name: Moonbase XCM Global Asset Registry Generation | |
run: node xcmgar registry -r moonbase | |
- name: XCM GAR metadata Generation | |
run: node xcmgar generate -m -u | |
- name: Show diff | |
run: | | |
git diff assets | |
git diff xcAssets | |
git diff xcmRegistry | |
git diff metadata | |
- name: Configure Git Client | |
run: | | |
git config user.name github-actions | |
git config user.email github-actions@github.com | |
- name: Set timestamp | |
run: | | |
echo "CURRENT_TIMESTAMP=$(date +'%Y-%m-%d %H:%M')" >> $GITHUB_ENV | |
echo "CommitHash=$(cut -d'-' -f2 <<< $(node xcmgar -V))" >> $GITHUB_ENV | |
- name: Commit changes to assets | |
run: | | |
git add assets/*.json && \ | |
git add xcmRegistry/*.json && \ | |
git add xcAssets/*.json && \ | |
git add metadata/*.json && \ | |
git commit -m "[Auto] XCM Assets/Registry Updates (${{ env.CURRENT_TIMESTAMP }}-${{env.CommitHash}})" || echo "No changes to commit" | |
- name: Push changes to assets | |
run: git push origin $BRANCH_NAME | |
- name: send Notification to telegram | |
uses: appleboy/telegram-action@master | |
with: | |
to: ${{ secrets.TELEGRAM_TO }} | |
token: ${{ secrets.TELEGRAM_TOKEN }} | |
message: | | |
${{ github.actor }} created commit: | |
Commit message: ${{ github.event.commits[0].message }} | |
Repository: ${{ github.repository }} | |
See changes: https://github.com/${{ github.repository }}/commit/${{github.sha}} | |
env: | |
BRANCH_NAME: ${{ github.head_ref || github.ref_name }} |