You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
568tools/.github/workflows/568tools_Release.yml

66 lines
2.0 KiB

name: Release
2 years ago
on:
push:
branches:
- '**'
- '!release'
jobs:
Release:
runs-on: ubuntu-latest
2 years ago
steps:
- name: Clone
2 years ago
run: |
echo '创建 tree/'
2 years ago
mkdir /home/runner/tree
echo '克隆 三个分支:'
2 years ago
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
2 years ago
echo '检查 tree/assets'
2 years ago
ls /home/runner/tree/assets
2 years ago
echo '检查 tree/main'
2 years ago
ls /home/runner/tree/main
- name: Checkout release branch
uses: actions/checkout@v3
with:
ref: release
2 years ago
- name: Merge
2 years ago
run: |
echo '清空 release'
rm -r ./*
echo '检查 release'
ls
echo '复制 tree/assets/* 到 release/'
2 years ago
cp -v -u -r /home/runner/tree/assets/* .
echo '复制 tree/main/* 到 release/'
2 years ago
cp -v -u -r /home/runner/tree/main/* .
echo '添加 lib 子模块到 release/lib/'
rm -r ./lib/
git submodule add -b tools https://github.com/PJ-568/568tools.git ./lib
2 years ago
- 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
2 years ago
run: |
git config --global user.name "PJ569-bot"
git config --global user.email "LiuTian-PJ568@PJ568.eu.org"
2 years ago
git add -A
git commit -m '自动 Release'
git push
- name: Ping Google
2 years ago
run: curl https://www.google.com/ping?sitemap=https://Tools.PJ568.eu.org/sitemap.xml