模組包 icon 更新 #10
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-Minecraft-resources-pack-And-release | |
# 控制工作流何時運行 | |
on: | |
# 允許從 Actions 標籤手動運行此工作流 | |
workflow_dispatch: | |
push: | |
tags: | |
- "release_v_*" | |
# 工作流運行由一個或多個可以順序或並行運行的任務組成 | |
jobs: | |
# 此工作流包含一個名為 "zip-and-release" 的任務 | |
zip-and-release: | |
# 設定工作運行的環境類型 | |
runs-on: ubuntu-latest | |
# 步驟代表作為任務的一部分將被執行的任務序列 | |
steps: | |
# 檢出最新的代碼到虛擬機器 | |
- uses: actions/checkout@v4 | |
# 取得版本號並設置環境變量 | |
- name: Set version | |
id: vars | |
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV | |
# 取得標籤的註釋信息,如果註釋不存在,使用預設值 | |
- name: Get tag annotation | |
id: tag_annotation | |
run: | | |
TAG_ANNOTATION=$(git tag -l --format='%(contents:subject)' ${{ env.VERSION }} || echo "No annotation exists.") | |
echo "TAG_ANNOTATION=${TAG_ANNOTATION}" >> $GITHUB_ENV | |
# 建立資源包,排除所有 PNG 文件 | |
- name: build resources pack | |
run: | | |
zip -r Translation-zh_tw-of-masa-series-mods_${{ env.VERSION }}.zip \ | |
assets/ \ | |
pack.mcmeta \ | |
pack.png \ | |
README.md \ | |
-x 'assets/*.png' | |
# 上傳並發布資源包 這是一個自動RELEASE | |
- name: upload | |
uses: ncipollo/[email protected] | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
artifacts: "Translation-zh_tw-of-masa-series-mods_${{ env.VERSION }}.zip" | |
name: "${{ env.VERSION }}" | |
# 在 Release 的描述中包含標籤的註釋,如果註釋不存在,使用預設值或空字符串 | |
body: |- | |
${{env.TAG_ANNOTATION }} | |
This is an auto-attachment release. | |
# 允許更新現有的 Release。如果已經存在一個 Release,其標籤與當前推送的標籤匹配 | |
# 該 Release 將被更新,而不是創建一個新的 Release。 | |
allowUpdates: true | |
# 在更新 Release 時,先刪除所有舊的附加文件,然後再上傳新的附加文件。 | |
removeArtifacts: true |