Update iso639.txt with parse-langtags #78
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 workflow will get the latest langtags.json file to generate iso639.txt | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions | |
name: Update iso639.txt with parse-langtags | |
on: | |
workflow_dispatch: | |
schedule: | |
# 1st day of each month | |
- cron: '0 0 1 * *' | |
jobs: | |
build: | |
runs-on: windows-latest | |
defaults: | |
run: | |
working-directory: ./DevUtils/parse-langtags | |
strategy: | |
matrix: | |
node-version: [18.x] | |
architecture: [x64] | |
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/ | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Use Node.js ${{ matrix.node-version }} | |
uses: actions/setup-node@v3 | |
- name: Install project dependencies | |
run: npm install | |
- name: Get the latest langtags.json | |
run: C:\msys64\usr\bin\wget.exe -O langtags.json https://github.com/silnrsi/langtags/raw/master/pub/langtags.json | |
- name: Install TypeScript | |
run: npx tsc | |
- name: Compile parse-langtags | |
run: npm run build | |
- name: Generate iso639.txt | |
run: node ./dist/index.js -o iso639.txt | |
- name: Show file locations | |
run: | | |
pwd | |
ls | |
- name: Save iso639.txt artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: iso639.txt | |
path: DevUtils\parse-langtags\iso639.txt | |
retention-days: 30 | |
- name: Save langtags.json artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: langtags.json | |
path: DevUtils\parse-langtags\langtags.json | |
retention-days: 30 | |
- name: Overwrite file in DistFiles/ | |
run: move iso639.txt ../../DistFiles/ -Force | |
#run: move ./dist/index.js ../../DistFiles/iso639.txt -Force #force diff for testing | |
- name: Create Pull Request | |
uses: peter-evans/create-pull-request@v4 | |
with: | |
commit-message: 'auto: update iso639.txt' | |
title: 'auto: Update iso639.txt' | |
body: Auto-generated PR to update iso639.txt | |
branch: 'auto/update-iso639' | |
labels: auto | |
base: 'master' | |
delete-branch: true |