From d31bb440c3a2a63f4ae71715c9602f856183c5df Mon Sep 17 00:00:00 2001 From: techknowlogick Date: Mon, 24 Apr 2023 21:53:59 -0400 Subject: [PATCH 1/4] switch to use actions from drone for cron --- .drone.yml | 103 ------------------------ .github/workflows/cron-licenses.yml | 27 +++++++ .github/workflows/cron-translations.yml | 47 +++++++++++ 3 files changed, 74 insertions(+), 103 deletions(-) create mode 100644 .github/workflows/cron-licenses.yml create mode 100644 .github/workflows/cron-translations.yml diff --git a/.drone.yml b/.drone.yml index 087ddd6166f48..5096ce781fe20 100644 --- a/.drone.yml +++ b/.drone.yml @@ -773,109 +773,6 @@ steps: - name: deps path: /go ---- -kind: pipeline -name: update_translations - -platform: - os: linux - arch: arm64 - -trigger: - branch: - - main - event: - - cron - cron: - - update_translations - -steps: - - name: download - image: jonasfranz/crowdin - pull: always - settings: - download: true - export_dir: options/locale/ - ignore_branch: true - project_identifier: gitea - environment: - CROWDIN_KEY: - from_secret: crowdin_key - - - name: update - image: alpine:3.17 - pull: always - commands: - - ./build/update-locales.sh - - - name: push - image: appleboy/drone-git-push - pull: always - settings: - author_email: "teabot@gitea.io" - author_name: GiteaBot - branch: main - commit: true - commit_message: "[skip ci] Updated translations via Crowdin" - remote: "git@github.com:go-gitea/gitea.git" - environment: - DRONE_COMMIT_AUTHOR_EMAIL: "teabot@gitea.io" - DRONE_COMMIT_AUTHOR: GiteaBot - GIT_PUSH_SSH_KEY: - from_secret: git_push_ssh_key - - - name: upload_translations - image: jonasfranz/crowdin - pull: always - settings: - files: - locale_en-US.ini: options/locale/locale_en-US.ini - ignore_branch: true - project_identifier: gitea - environment: - CROWDIN_KEY: - from_secret: crowdin_key - ---- -kind: pipeline -type: docker -name: update_gitignore_and_licenses - -platform: - os: linux - arch: arm64 - -trigger: - branch: - - main - event: - - cron - cron: - - update_gitignore_and_licenses - -steps: - - name: download - image: gitea/test_env:linux-1.20-amd64 - pull: always - commands: - - timeout -s ABRT 40m make generate-license generate-gitignore - - - name: push - image: appleboy/drone-git-push - pull: always - settings: - author_email: "teabot@gitea.io" - author_name: "GiteaBot" - branch: main - commit: true - commit_message: "[skip ci] Updated licenses and gitignores" - remote: "git@github.com:go-gitea/gitea.git" - environment: - DRONE_COMMIT_AUTHOR_EMAIL: "teabot@gitea.io" - DRONE_COMMIT_AUTHOR: "GiteaBot" - GIT_PUSH_SSH_KEY: - from_secret: git_push_ssh_key - --- kind: pipeline type: docker diff --git a/.github/workflows/cron-licenses.yml b/.github/workflows/cron-licenses.yml new file mode 100644 index 0000000000000..d67eb395144db --- /dev/null +++ b/.github/workflows/cron-licenses.yml @@ -0,0 +1,27 @@ +on: + cron: + - cron: "19 58 * * *" # every day at 7:58 PM UTC + +name: Update licenses and gitignores + +jobs: + cron: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - uses: actions/setup-go@v3 + with: + go-version: '>=1.20.1' + - name: update licenses and gitignores + run: timeout -s ABRT 40m make generate-license generate-gitignore + - name: push translations to repo + uses: appleboy/git-push-action@main + with: + author_email: "teabot@gitea.io" + author_name: GiteaBot + branch: main + commit: true + commit_message: "[skip ci] Updated licenses and gitignores" + remote: "git@github.com:go-gitea/gitea.git" + ssh_key: ${{ secrets.DEPLOY_KEY }} diff --git a/.github/workflows/cron-translations.yml b/.github/workflows/cron-translations.yml new file mode 100644 index 0000000000000..b40b4122444f4 --- /dev/null +++ b/.github/workflows/cron-translations.yml @@ -0,0 +1,47 @@ +on: + cron: + - cron: "19 58 * * *" # every day at 7:58 PM UTC + +name: Pull translations from Crowdin + +jobs: + crowdin_pull: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: download from crowdin + uses: docker://jonasfranz/crowdin + env: + CROWDIN_KEY: ${{ secrets.CROWDIN_KEY }} + PLUGIN_DOWNLOAD: true + PLUGIN_EXPORT_DIR: options/locale/ + PLUGIN_IGNORE_BRANCH: true + PLUGIN_PROJECT_IDENTIFIER: gitea + - name: update locales + run: ./build/update-locales.sh + - name: push translations to repo + uses: appleboy/git-push-action@main + with: + author_email: "teabot@gitea.io" + author_name: GiteaBot + branch: main + commit: true + commit_message: "[skip ci] Updated translations via Crowdin" + remote: "git@github.com:go-gitea/gitea.git" + ssh_key: ${{ secrets.DEPLOY_KEY }} + crowdin_push: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: push translations to crowdin + uses: docker://jonasfranz/crowdin + env: + CROWDIN_KEY: ${{ secrets.CROWDIN_KEY }} + PLUGIN_UPLOAD: true + PLUGIN_IGNORE_BRANCH: true + PLUGIN_PROJECT_IDENTIFIER: gitea + PLUGIN_FILES: | + locale_en-US.ini: options/locale/locale_en-US.ini + PLUGIN_BRANCH: main From 3a569ee8da833aeed57eb7974b383892d24bbf83 Mon Sep 17 00:00:00 2001 From: techknowlogick Date: Mon, 24 Apr 2023 22:06:10 -0400 Subject: [PATCH 2/4] weekly on licenses --- .github/workflows/cron-licenses.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cron-licenses.yml b/.github/workflows/cron-licenses.yml index d67eb395144db..d5ca2265e07e4 100644 --- a/.github/workflows/cron-licenses.yml +++ b/.github/workflows/cron-licenses.yml @@ -1,6 +1,7 @@ on: cron: - - cron: "19 58 * * *" # every day at 7:58 PM UTC + # weekly on Monday at 10:00 UTC + - cron: "0 10 * * 1" name: Update licenses and gitignores From 72f297e88c357c5bf913df09c536d44cd8163b2b Mon Sep 17 00:00:00 2001 From: techknowlogick Date: Mon, 24 Apr 2023 22:30:52 -0400 Subject: [PATCH 3/4] use stable version --- .github/workflows/cron-licenses.yml | 2 +- .github/workflows/cron-translations.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cron-licenses.yml b/.github/workflows/cron-licenses.yml index d5ca2265e07e4..2086144b65ebd 100644 --- a/.github/workflows/cron-licenses.yml +++ b/.github/workflows/cron-licenses.yml @@ -17,7 +17,7 @@ jobs: - name: update licenses and gitignores run: timeout -s ABRT 40m make generate-license generate-gitignore - name: push translations to repo - uses: appleboy/git-push-action@main + uses: appleboy/git-push-action@v0.0.2 with: author_email: "teabot@gitea.io" author_name: GiteaBot diff --git a/.github/workflows/cron-translations.yml b/.github/workflows/cron-translations.yml index b40b4122444f4..3c10a1437520e 100644 --- a/.github/workflows/cron-translations.yml +++ b/.github/workflows/cron-translations.yml @@ -21,7 +21,7 @@ jobs: - name: update locales run: ./build/update-locales.sh - name: push translations to repo - uses: appleboy/git-push-action@main + uses: appleboy/git-push-action@v0.0.2 with: author_email: "teabot@gitea.io" author_name: GiteaBot From b98023ce3841fa6488c61d06d9125f887a306808 Mon Sep 17 00:00:00 2001 From: techknowlogick Date: Tue, 25 Apr 2023 00:28:27 -0400 Subject: [PATCH 4/4] use midnight UTC --- .github/workflows/cron-licenses.yml | 4 ++-- .github/workflows/cron-translations.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cron-licenses.yml b/.github/workflows/cron-licenses.yml index 2086144b65ebd..21ab72a5e9f25 100644 --- a/.github/workflows/cron-licenses.yml +++ b/.github/workflows/cron-licenses.yml @@ -1,7 +1,7 @@ on: cron: - # weekly on Monday at 10:00 UTC - - cron: "0 10 * * 1" + # weekly on Monday at 0:07 UTC + - cron: "7 0 * * 1" name: Update licenses and gitignores diff --git a/.github/workflows/cron-translations.yml b/.github/workflows/cron-translations.yml index 3c10a1437520e..937a7a59a13f6 100644 --- a/.github/workflows/cron-translations.yml +++ b/.github/workflows/cron-translations.yml @@ -1,6 +1,6 @@ on: cron: - - cron: "19 58 * * *" # every day at 7:58 PM UTC + - cron: "7 0 * * *" # every day at 0:07 UTC name: Pull translations from Crowdin