-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add GitHub action to automatically upgrade the metadata (#62)
* Fix generate files isoCodeImport * Add update meta data action * Test * Add checkout step * Update Metadata * Set real cron value --------- Co-authored-by: GitHub Actions <actions@github.com>
- Loading branch information
1 parent
875a2d4
commit 83b9745
Showing
10 changed files
with
340 additions
and
176 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,36 @@ | ||
name: Update Metadata | ||
|
||
on: | ||
schedule: | ||
# At 12:00 AM, on day 1 of each month | ||
- cron: "0 0 1 * *" | ||
|
||
jobs: | ||
generate: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: dart-lang/setup-dart@v1 | ||
|
||
- name: Install dependencies | ||
run: dart pub get | ||
|
||
- name: Fetch LibPhoneNumber Metadata | ||
run: curl -o resources/data_sources/PhoneNumberMetadata.xml https://raw.githubusercontent.com/google/libphonenumber/master/resources/PhoneNumberMetadata.xml | ||
|
||
- name: Process Metadata | ||
run: dart resources/data_sources/convert_metadata.dart | ||
|
||
- name: Generate Files | ||
run: | | ||
dart pub get | ||
dart resources/generate_files.dart && dart format lib/src && dart fix --apply | ||
- name: Commit and Push Updated Files | ||
run: | | ||
git config --global user.name "GitHub Actions" | ||
git config --global user.email "actions@github.com" | ||
git add . | ||
git commit -m "Update Metadata" || echo "Nothing to commit!" | ||
git push |
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 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 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 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
Oops, something went wrong.