更新自动打包文件 #9
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: Build and Package for Tag | |
on: | |
push: | |
tags: | |
- '*' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Get project name | |
id: vars | |
run: echo "::set-output name=project_name::$(basename $(git rev-parse --show-toplevel))" | |
- name: Package files as ZIP | |
run: | | |
# 定义忽略文件和目录的列表 | |
IGNORED_FILES=" | |
.github/* | |
pkgmeta.yaml | |
.gitignore | |
" | |
# 使用 zip 命令打包,并忽略指定的文件和目录 | |
zip -r "${{ steps.vars.outputs.project_name }}-${{ github.ref_name }}.zip" . -x $IGNORED_FILES | |
- name: Upload artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: build-artifact | |
path: "${{ steps.vars.outputs.project_name }}-${{ github.ref_name }}.zip" |