Skip to content

Publish XML updates #125

Publish XML updates

Publish XML updates #125

name: Publish XML updates
on:
workflow_dispatch: # manually (via GitHub UI)
schedule:
- cron: "0 10 * * 5" # every Friday at 10:00
jobs:
get-curr:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
# Using '--force' to bypass self-dependency error
- run: npm i --no-save --force iso4217-json@npm:@iso4217/json@latest
- uses: actions/upload-artifact@v4
with:
name: curr
path: node_modules/iso4217-json/data.json
get-next:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
- run: npm ci
- run: npm run build-data-file
- uses: actions/upload-artifact@v4
with:
name: next
path: data.json
compare:
runs-on: ubuntu-20.04
needs:
- get-curr
- get-next
outputs:
winner: ${{ steps.s1.outputs.o1 }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
- uses: actions/download-artifact@v4
with:
name: curr
path: curr
- uses: actions/download-artifact@v4
with:
name: next
path: next
- id: s1
name: Determine which file to use
run: |2
if cmp -s curr/data.json next/data.json
then
echo Data is the same, no update is needed
echo "o1=curr" >> $GITHUB_OUTPUT
else
echo Data has changed, an update is required
echo "o1=next" >> $GITHUB_OUTPUT
fi
publish:
runs-on: ubuntu-20.04
needs: compare
if: ${{needs.compare.outputs.winner == 'next'}}
steps:
- uses: actions/checkout@v4
with:
token: ${{secrets.PARZHBOT_PAT}}
- name: Set Git user name and email
run: |2
git config --global user.name 'parzhbot'
git config --global user.email '[email protected]'
- run: npm ci
- run: npm version --git-tag-version $(npm run --silent compose-version-number:ci)
env:
VERSIONING_IS_ALLOWED: "true"
- run: git push --follow-tags