From b7686f1639970d0103a3e7baea54d87561279e5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=80=97=E5=AD=90?= Date: Fri, 28 Feb 2025 00:32:45 +0800 Subject: [PATCH] ci: migrate to github actions --- .gitattributes | 2 +- .github/workflows/checksums.yml | 8 +++----- .gitlab-ci.yml | 23 ----------------------- 3 files changed, 4 insertions(+), 29 deletions(-) delete mode 100644 .gitlab-ci.yml diff --git a/.gitattributes b/.gitattributes index 1d90a1e..0e63d94 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,4 +1,4 @@ * filter=lfs diff=lfs merge=lfs -text .gitattributes !filter !diff !merge -.gitlab-ci.yml !filter !diff !merge +.github/** !filter !diff !merge README.md !filter !diff !merge diff --git a/.github/workflows/checksums.yml b/.github/workflows/checksums.yml index 3a17583..46d8c71 100644 --- a/.github/workflows/checksums.yml +++ b/.github/workflows/checksums.yml @@ -6,13 +6,12 @@ on: pull_request: jobs: checksums: - runs-on: ubuntu-latest + runs-on: cn steps: - name: Checkout repository uses: actions/checkout@v4 with: lfs: true - - name: Generate checksums run: | set -e @@ -21,8 +20,7 @@ jobs: filename=$(basename "$file"); sha256sum -b "$file" | sed "s|$file|$filename|" > "${file}.sha256"; done - - name: Commit changes - uses: stefanzweifel/git-auto-commit-action@v5 + uses: actions/git-auto-commit-action@v5 with: - commit_message: "chore: update checksum files" \ No newline at end of file + commit_message: "chore: update checksum files" diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index 5801fc7..0000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,23 +0,0 @@ -checksums: - image: alpine:latest - before_script: - - sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories - - apk add --no-cache git git-lfs - - git config --global user.name "CI" - - git config --global user.email "ci@haozi.net" - - git remote set-url origin "https://gitlab-ci-token:${GITLAB_TOKEN}@${CI_SERVER_HOST}/${CI_PROJECT_PATH}.git" - - git config lfs.https://gitlab-ci-token:${GITLAB_TOKEN}@${CI_SERVER_HOST}/${CI_PROJECT_PATH}.git/info/lfs.locksverify true - - git checkout -f $CI_COMMIT_REF_NAME - script: | - set -e - IFS=$'\n' - git fetch origin - git reset --hard origin/$CI_COMMIT_REF_NAME - for file in $(git ls-files | grep "^panel/" | grep -v ".sha256$" | grep -v ".txt$"); do - filename=$(basename "$file"); - sha256sum -b "$file" | sed "s|$file|$filename|" > "${file}.sha256"; - done - git add -A - git commit -m "chore: update checksum files" || true - git push origin $CI_COMMIT_REF_NAME - unset IFS