name: Release on: push: branches: - '**' - '!release' jobs: Release: runs-on: ubuntu-latest steps: - name: Clone run: | echo '创建 tree/:' mkdir /home/runner/tree echo '克隆 三个分支:' git clone https://github.com/PJ-568/568tools.git -b assets /home/runner/tree/assets git clone https://github.com/PJ-568/568tools.git -b main /home/runner/tree/main echo '检查 tree/assets:' ls /home/runner/tree/assets echo '检查 tree/main:' ls /home/runner/tree/main - name: Checkout release branch uses: actions/checkout@v3 with: ref: release - name: Merge run: | echo '清空 release:' rm -r ./* echo '检查 release:' ls echo '复制 tree/assets/* 到 release/:' cp -v -u -r /home/runner/tree/assets/* . echo '复制 tree/main/* 到 release/:' cp -v -u -r /home/runner/tree/main/* . echo '添加 lib 子模块到 release/lib/:' rm -r ./lib/ git rm --cached lib git submodule add -b tools https://github.com/PJ-568/568tools.git ./lib - name: HTML/CSS/JS Minifier uses: docker://devatherock/minify-js:2.0.0 with: add_suffix: false # Optional - name: Generate the sitemap id: sitemap uses: cicirello/generate-sitemap@v1 with: base-url-path: https://tools.pj568.eu.org/ - name: Output sitemap stats run: | echo "sitemap-path = ${{ steps.sitemap.outputs.sitemap-path }}" echo "url-count = ${{ steps.sitemap.outputs.url-count }}" echo "excluded-count = ${{ steps.sitemap.outputs.excluded-count }}" - name: Push run: | git config --global user.name "PJ569-bot" git config --global user.email "LiuTian-PJ568@PJ568.eu.org" git add -A git commit -m '自动 Release' git push - name: Ping Google run: curl https://www.google.com/ping?sitemap=https://Tools.PJ568.eu.org/sitemap.xml