forked from line/armeria
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a scheduled job that updates public suffix list periodically (lin…
…e#3590) Motivation: Public Suffix List is automatically updated when building projects. It should be inefficient to update the public_suffixes.txt on every PR. Additionally, the unexpectedly updated file makes contributors embarrassed. We've repeatedly explained why the file was changed to them. line#3546 Modifications: - Remove `PublicSuffixesTask` dependency from build phases. - Add a GitHub Actions job that schedules to update the public suffix list every day. Result: - Improved build process and less noise in PR diffs - Fixes line#3546
- Loading branch information
Showing
3 changed files
with
59 additions
and
5 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
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,59 @@ | ||
name: Update Public Suffix List | ||
on: | ||
schedule: | ||
- cron: '0 10 * * *' | ||
|
||
jobs: | ||
update-psl: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- id: setup-jdk-15 | ||
name: Set up JDK 15 | ||
uses: actions/setup-java@v2 | ||
with: | ||
distribution: 'adopt' | ||
java-version: '15' | ||
|
||
- name: Restore Gradle Cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/.gradle/wrapper/dists | ||
~/.gradle/caches/jars-3 | ||
~/.gradle/caches/modules-2 | ||
~/.gradle/caches/package-lists | ||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | ||
restore-keys: | | ||
${{ runner.os }}-gradle- | ||
- name: Build with Gradle | ||
run: | | ||
./gradlew --no-daemon --stacktrace :core:publicSuffixes | ||
- name: Import GPG key | ||
id: import_gpg | ||
uses: crazy-max/ghaction-import-gpg@v3 | ||
with: | ||
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} | ||
git-user-signingkey: true | ||
git-commit-gpgsign: true | ||
|
||
- name: Push updated public suffix list | ||
uses: stefanzweifel/git-auto-commit-action@v4 | ||
with: | ||
commit_options: '-S' | ||
commit_message: Update public suffix list | ||
file_pattern: core/src/main/resources/com/linecorp/armeria/public_suffixes.txt | ||
commit_user_name: Meri Kim | ||
commit_user_email: [email protected] | ||
commit_author: Meri Kim <[email protected]> | ||
|
||
- name: Cleanup Gradle Cache | ||
# Remove some files from the Gradle cache, so they aren't cached by GitHub Actions. | ||
# Restoring these files from a GitHub Actions cache might cause problems for future builds. | ||
run: | | ||
rm -f ~/.gradle/caches/modules-2/modules-2.lock || true | ||
rm -f ~/.gradle/caches/modules-2/gc.properties || true | ||
shell: bash |
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