Merge branch 'dev' #33
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: main | |
on: | |
# 每当 push 到 main 分支时触发部署 | |
push: | |
tags: | |
- "v*.*.*" | |
# 手动触发部署 | |
workflow_dispatch: | |
jobs: | |
docs: | |
runs-on: ubuntu-latest | |
steps: | |
- name: 🏡拉取代码 | |
uses: actions/checkout@v3 | |
with: | |
# “最近更新时间” 等 git 日志相关信息,需要拉取全部提交记录 | |
fetch-depth: 0 | |
- name: 💾缓存 Composer 依赖 | |
uses: actions/cache@v3 | |
with: | |
path: /tmp/composer-cache | |
key: ${{ runner.os }}-${{ hashFiles('**/composer.lock') }} | |
- name: ✍️提取标签名称 | |
id: github_ref | |
run: tag=$(echo "${{ github.ref }}" | cut -d '/' -f 3) | |
echo "tag=$tag" >> $GITHUB_STATE | |
- name: 🛠️安装依赖 | |
uses: php-actions/composer@v6 | |
with: | |
php_version: "8.1" | |
version: 2 | |
- name: ❌删除非必要文件 | |
run: | | |
rm -rf .gitignore .github .git DOCKER_ENV docker_tag output.log composer.json composer.lock script lock.txt upload.md test.env think | |
- name: 📦压缩为zip | |
run: zip -r LoveCards-v2.3.0.zip ./ # 记得修改 | |
- name: 🎅创建发布并上传压缩包 | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
tag_name: ${{ steps.github_ref.outputs.tag }} | |
name: 2.3.0[17] # 记得修改 | |
body_path: RELEASE.txt | |
draft: false | |
prerelease: true | |
files: | # 记得修改 | |
LoveCards-v2.3.0.zip | |
LICENSE | |
env: | |
# @see https://docs.github.com/cn/actions/reference/authentication-in-a-workflow#about-the-github_token-secret | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |