Skip to content

Commit 61a73ed

Browse files
switch to use Actions from drone for cron (#24314)
Move drone cron pipelines to (GitHub) Actions. As these are mostly compatible with Gitea Actions, when we start to dogfood, these will already be migrated.
1 parent fa86a1b commit 61a73ed

File tree

3 files changed

+75
-103
lines changed

3 files changed

+75
-103
lines changed

.drone.yml

Lines changed: 0 additions & 103 deletions
Original file line numberDiff line numberDiff line change
@@ -773,109 +773,6 @@ steps:
773773
- name: deps
774774
path: /go
775775

776-
---
777-
kind: pipeline
778-
name: update_translations
779-
780-
platform:
781-
os: linux
782-
arch: arm64
783-
784-
trigger:
785-
branch:
786-
- main
787-
event:
788-
- cron
789-
cron:
790-
- update_translations
791-
792-
steps:
793-
- name: download
794-
image: jonasfranz/crowdin
795-
pull: always
796-
settings:
797-
download: true
798-
export_dir: options/locale/
799-
ignore_branch: true
800-
project_identifier: gitea
801-
environment:
802-
CROWDIN_KEY:
803-
from_secret: crowdin_key
804-
805-
- name: update
806-
image: alpine:3.17
807-
pull: always
808-
commands:
809-
- ./build/update-locales.sh
810-
811-
- name: push
812-
image: appleboy/drone-git-push
813-
pull: always
814-
settings:
815-
author_email: "[email protected]"
816-
author_name: GiteaBot
817-
branch: main
818-
commit: true
819-
commit_message: "[skip ci] Updated translations via Crowdin"
820-
remote: "[email protected]:go-gitea/gitea.git"
821-
environment:
822-
DRONE_COMMIT_AUTHOR_EMAIL: "[email protected]"
823-
DRONE_COMMIT_AUTHOR: GiteaBot
824-
GIT_PUSH_SSH_KEY:
825-
from_secret: git_push_ssh_key
826-
827-
- name: upload_translations
828-
image: jonasfranz/crowdin
829-
pull: always
830-
settings:
831-
files:
832-
locale_en-US.ini: options/locale/locale_en-US.ini
833-
ignore_branch: true
834-
project_identifier: gitea
835-
environment:
836-
CROWDIN_KEY:
837-
from_secret: crowdin_key
838-
839-
---
840-
kind: pipeline
841-
type: docker
842-
name: update_gitignore_and_licenses
843-
844-
platform:
845-
os: linux
846-
arch: arm64
847-
848-
trigger:
849-
branch:
850-
- main
851-
event:
852-
- cron
853-
cron:
854-
- update_gitignore_and_licenses
855-
856-
steps:
857-
- name: download
858-
image: gitea/test_env:linux-1.20-amd64
859-
pull: always
860-
commands:
861-
- timeout -s ABRT 40m make generate-license generate-gitignore
862-
863-
- name: push
864-
image: appleboy/drone-git-push
865-
pull: always
866-
settings:
867-
author_email: "[email protected]"
868-
author_name: "GiteaBot"
869-
branch: main
870-
commit: true
871-
commit_message: "[skip ci] Updated licenses and gitignores"
872-
remote: "[email protected]:go-gitea/gitea.git"
873-
environment:
874-
DRONE_COMMIT_AUTHOR_EMAIL: "[email protected]"
875-
DRONE_COMMIT_AUTHOR: "GiteaBot"
876-
GIT_PUSH_SSH_KEY:
877-
from_secret: git_push_ssh_key
878-
879776
---
880777
kind: pipeline
881778
type: docker

.github/workflows/cron-licenses.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
on:
2+
cron:
3+
# weekly on Monday at 0:07 UTC
4+
- cron: "7 0 * * 1"
5+
6+
name: Update licenses and gitignores
7+
8+
jobs:
9+
cron:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v3
14+
- uses: actions/setup-go@v3
15+
with:
16+
go-version: '>=1.20.1'
17+
- name: update licenses and gitignores
18+
run: timeout -s ABRT 40m make generate-license generate-gitignore
19+
- name: push translations to repo
20+
uses: appleboy/[email protected]
21+
with:
22+
author_email: "[email protected]"
23+
author_name: GiteaBot
24+
branch: main
25+
commit: true
26+
commit_message: "[skip ci] Updated licenses and gitignores"
27+
remote: "[email protected]:go-gitea/gitea.git"
28+
ssh_key: ${{ secrets.DEPLOY_KEY }}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
on:
2+
cron:
3+
- cron: "7 0 * * *" # every day at 0:07 UTC
4+
5+
name: Pull translations from Crowdin
6+
7+
jobs:
8+
crowdin_pull:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v3
13+
- name: download from crowdin
14+
uses: docker://jonasfranz/crowdin
15+
env:
16+
CROWDIN_KEY: ${{ secrets.CROWDIN_KEY }}
17+
PLUGIN_DOWNLOAD: true
18+
PLUGIN_EXPORT_DIR: options/locale/
19+
PLUGIN_IGNORE_BRANCH: true
20+
PLUGIN_PROJECT_IDENTIFIER: gitea
21+
- name: update locales
22+
run: ./build/update-locales.sh
23+
- name: push translations to repo
24+
uses: appleboy/[email protected]
25+
with:
26+
author_email: "[email protected]"
27+
author_name: GiteaBot
28+
branch: main
29+
commit: true
30+
commit_message: "[skip ci] Updated translations via Crowdin"
31+
remote: "[email protected]:go-gitea/gitea.git"
32+
ssh_key: ${{ secrets.DEPLOY_KEY }}
33+
crowdin_push:
34+
runs-on: ubuntu-latest
35+
steps:
36+
- name: Checkout
37+
uses: actions/checkout@v3
38+
- name: push translations to crowdin
39+
uses: docker://jonasfranz/crowdin
40+
env:
41+
CROWDIN_KEY: ${{ secrets.CROWDIN_KEY }}
42+
PLUGIN_UPLOAD: true
43+
PLUGIN_IGNORE_BRANCH: true
44+
PLUGIN_PROJECT_IDENTIFIER: gitea
45+
PLUGIN_FILES: |
46+
locale_en-US.ini: options/locale/locale_en-US.ini
47+
PLUGIN_BRANCH: main

0 commit comments

Comments
 (0)