工作流支持内测版打包;增加制品包上传
This commit is contained in:
22
.github/workflows/release_new_version.yaml
vendored
22
.github/workflows/release_new_version.yaml
vendored
@@ -10,7 +10,8 @@ on:
|
||||
required: true
|
||||
type: choice
|
||||
options:
|
||||
- '测试版'
|
||||
- '内测版'
|
||||
- '公测版'
|
||||
- '正式版'
|
||||
env:
|
||||
new_version: ${{ github.event.inputs.release_version }}
|
||||
@@ -22,15 +23,16 @@ jobs:
|
||||
- name: Clone Repository
|
||||
uses: actions/checkout@main
|
||||
- name: Update Version Number
|
||||
if: ${{ github.event.inputs.release_type != '内测版' }}
|
||||
run: |
|
||||
if [[ "${new_type}" == "正式版" ]]; then
|
||||
sed -i "1i ${new_version}" ./bin/release_version
|
||||
else
|
||||
elif [[ "${new_type}" == "公测版" ]]; then
|
||||
sed -i "s/versionsh=.*/versionsh=${new_version}/" ./bin/version
|
||||
sed -i "s/version=.*/version=${new_version}/" ./scripts/init.sh
|
||||
fi
|
||||
- name: Package
|
||||
if: ${{ github.event.inputs.release_type == '测试版' }}
|
||||
if: ${{ github.event.inputs.release_type != '正式版' }}
|
||||
run: |
|
||||
cd ./bin
|
||||
# 打包 clashfm.tar.gz
|
||||
@@ -49,6 +51,7 @@ jobs:
|
||||
tar zcvf ../ShellClash.tar.gz *
|
||||
popd && rm -fr ./ShellClash
|
||||
- name: Commit and push
|
||||
if: ${{ github.event.inputs.release_type != '内测版' }}
|
||||
run: |
|
||||
git config --global user.email "juewuy@gmail.com" && git config --global user.name "Bot"
|
||||
git add . && git commit -m "${new_type} ${new_version} 打包" || exit 0
|
||||
@@ -57,4 +60,15 @@ jobs:
|
||||
git tag ${new_version}
|
||||
git push origin ${new_version}
|
||||
fi
|
||||
|
||||
- name: Package Artifact
|
||||
id: package_artifact
|
||||
run: |
|
||||
mkdir artifacts
|
||||
cp ./bin/clashfm.tar.gz ./artifacts/
|
||||
cp ./bin/ShellClash.tar.gz ./artifacts/
|
||||
echo "artifact_name=${new_type}_${new_version}_$(date +%Y%m%d%H%M%S)" >> $GITHUB_OUTPUT
|
||||
- name: Upload Test Artifact
|
||||
uses: actions/upload-artifact@main
|
||||
with:
|
||||
name: ${{ steps.package_artifact.outputs.artifact_name }}
|
||||
path: ./artifacts/*
|
||||
|
||||
Reference in New Issue
Block a user