diff --git a/.github/workflows/tag.yaml b/.github/workflows/deploy.yaml similarity index 66% rename from .github/workflows/tag.yaml rename to .github/workflows/deploy.yaml index 7dc7d6c..88dd224 100644 --- a/.github/workflows/tag.yaml +++ b/.github/workflows/deploy.yaml @@ -1,4 +1,4 @@ -name: Tag-CI +name: Deploy-CI on: push: @@ -22,8 +22,8 @@ jobs: run: | git checkout ${BRANCH_NAME} bash ./tools/gitsync.sh pack - bash -x ./tools/gitsync.sh deploy mbfiles ${BRANCH_NAME} ${GH_REF} - bash -x ./tools/gitsync.sh deploy mbfiles ${BRANCH_NAME} ${CO_REF} + bash ./tools/gitsync.sh deploy mbfiles ${BRANCH_NAME} ${GH_REF} + bash ./tools/gitsync.sh deploy mbfiles ${BRANCH_NAME} ${CO_REF} test-job: runs-on: ubuntu-latest @@ -37,8 +37,8 @@ jobs: run: | git checkout ${BRANCH_NAME} bash ./tools/gitsync.sh pack - bash -x ./tools/gitsync.sh deploy mbfiles ${BRANCH_NAME} ${GH_REF} - bash -x ./tools/gitsync.sh deploy mbfiles ${BRANCH_NAME} ${CO_REF} + bash ./tools/gitsync.sh deploy mbfiles ${BRANCH_NAME} ${GH_REF} + bash ./tools/gitsync.sh deploy mbfiles ${BRANCH_NAME} ${CO_REF} dev-job: runs-on: ubuntu-latest @@ -52,5 +52,5 @@ jobs: run: | git checkout ${BRANCH_NAME} bash ./tools/gitsync.sh pack - bash -x ./tools/gitsync.sh deploy mbfiles ${BRANCH_NAME} ${GH_REF} - bash -x ./tools/gitsync.sh deploy mbfiles ${BRANCH_NAME} ${CO_REF} + bash ./tools/gitsync.sh deploy mbfiles ${BRANCH_NAME} ${GH_REF} + bash ./tools/gitsync.sh deploy mbfiles ${BRANCH_NAME} ${CO_REF} diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index fd3d324..29b5251 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -15,5 +15,5 @@ jobs: - name: Pack And Deploy run: | bash ./tools/gitsync.sh pack - bash -x ./tools/gitsync.sh deploy mbfiles `git branch | awk '$1 == "*"{print $2}'` ${GH_REF} - bash -x ./tools/gitsync.sh deploy mbfiles `git branch | awk '$1 == "*"{print $2}'` ${CO_REF} + bash ./tools/gitsync.sh deploy mbfiles `git branch | awk '$1 == "*"{print $2}'` ${GH_REF} + bash ./tools/gitsync.sh deploy mbfiles `git branch | awk '$1 == "*"{print $2}'` ${CO_REF} diff --git a/.github/workflows/master.yaml b/.github/workflows/master.yaml new file mode 100644 index 0000000..2717f51 --- /dev/null +++ b/.github/workflows/master.yaml @@ -0,0 +1,27 @@ +name: Master-CI + +on: + push: + tags: + - master-* + +env: + GH_REF: ${{ secrets.GH_REF }} + CO_REF: ${{ secrets.CO_REF }} + +jobs: + master-job: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@master + + - name: Pack And Deploy + env: + BRANCH_NAME: master + run: | + git checkout ${BRANCH_NAME} + bash ./tools/gitsync.sh pack + bash ./tools/gitsync.sh deploy mbfiles ${BRANCH_NAME} ${GH_REF} + bash ./tools/gitsync.sh deploy mbfiles ${BRANCH_NAME} ${CO_REF} + diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml new file mode 100644 index 0000000..0149bf0 --- /dev/null +++ b/.github/workflows/test.yaml @@ -0,0 +1,27 @@ +name: Test-CI + +on: + push: + tags: + - test-* + +env: + GH_REF: ${{ secrets.GH_REF }} + CO_REF: ${{ secrets.CO_REF }} + +jobs: + master-job: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@master + + - name: Pack And Deploy + env: + BRANCH_NAME: test + run: | + git checkout ${BRANCH_NAME} + bash ./tools/gitsync.sh pack + bash ./tools/gitsync.sh deploy mbfiles ${BRANCH_NAME} ${GH_REF} + bash ./tools/gitsync.sh deploy mbfiles ${BRANCH_NAME} ${CO_REF} + diff --git a/temp/known_hosts b/temp/known_hosts deleted file mode 100644 index 43a2fe8..0000000 --- a/temp/known_hosts +++ /dev/null @@ -1,6 +0,0 @@ -# gitee.com:22 SSH-2.0-Basalt-3.0.0 -gitee.com ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBMuEoYdx6to5oxR60IWj8uoe1aI0X1fKOHWOtLqTg1tsLT1iFwXV5JmFjU46EzeMBV/6EmI1uaRI6HiEPtPtJHE= -# gitee.com:22 SSH-2.0-Basalt-1.2.12 -gitee.com ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDMzG3r+88lWSDK9fyjcZmYsWGDBDmGoAasKMAmjoFloGt9HRQX2Qp4f9FY2XK/hsHYinvoh5Xytl9iaUNUWMfYR8q6VEMtOO87DgoAFcfKZHt0/nbAg9RoNTKYt6v8tPwYpr7N0JP/01nE4LFsNDnstr6H0bXSAzbKWCETLZfdPV4l2uSpRn3bU0ugoZ0aSKz5Dc/IloBfGCTvkSsxUydMRd/Chpjt6VxncDbp+Fa6pzsseK8OQzrg6Fgc5783EN3EQqZ2skqyCwExtx95BJlfx1B3luZnWfpkwNDnrZRT/Qx0OrWqyf0q6f9uQr+UG1S8qDcUn3e/9onq3rwBri8/ -# gitee.com:22 SSH-2.0-Basalt-3.0.0 -gitee.com ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIEKxHSJ7084RmkJ4YdEi5tngynE8aZe2uEoVVsB/OvYN \ No newline at end of file diff --git a/tools/deploy.sh b/tools/deploy.sh deleted file mode 100644 index ea825de..0000000 --- a/tools/deploy.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/bash - -GIT_BRANCH="$1" - -GIT_REF="$2" - -rm -rf mbfiles_git/ - -git clone "${GIT_REF}" mbfiles_git - -cd mbfiles_git - -git branch | grep -q "* ${GIT_BRANCH}" || git checkout -b "${GIT_BRANCH}" - -cp -rf ../mbfiles/* . - -git config --local user.email "monlor@qq.com" -git config --local user.name "monlor" - - -git lfs install - -git lfs track "*_darwin_*" - -git lfs track "*_linux_*" - -git lfs track "*.png" - -git config lfs.${CO_REF}/info/lfs.locksverify true - -git config lfs.allowincompletepush true - -git add . -git commit -m "$(TZ='Asia/Shanghai' date "+%Y-%m-%d %H:%M:%S")" -a - -git push "${CO_REF}" "${GIT_BRANCH}":"${GIT_BRANCH}" -f - -rm -rf mbfiles_git/ \ No newline at end of file diff --git a/tools/gitsync.sh b/tools/gitsync.sh index 824c7c4..3fabdf0 100755 --- a/tools/gitsync.sh +++ b/tools/gitsync.sh @@ -104,6 +104,8 @@ reset() { # $3: remote url with token deploy() { + sed -Ei "s#mbfiles/raw/[a-z]+#mbfiles/raw/$2#" $1/install.sh + cd $1 git init git config --local user.email "monlor@qq.com"