mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-01-29 00:35:38 +08:00
refactor: remove redundant steps for cleaning old release assets
This commit is contained in:
42
.github/workflows/autobuild.yml
vendored
42
.github/workflows/autobuild.yml
vendored
@@ -140,20 +140,6 @@ jobs:
|
||||
Created at ${{ env.BUILDTIME }}.
|
||||
EOF
|
||||
|
||||
- name: Remove old assets from release
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
TAG_NAME: ${{ env.TAG_NAME }}
|
||||
run: |
|
||||
VERSION=$(cat package.json | jq -r '.version')
|
||||
assets=$(gh release view "$TAG_NAME" --json assets -q '.assets[].name' || true)
|
||||
for asset in $assets; do
|
||||
if [[ "$asset" != *"$VERSION"* ]]; then
|
||||
echo "Deleting old asset: $asset"
|
||||
gh release delete-asset "$TAG_NAME" "$asset" -y
|
||||
fi
|
||||
done
|
||||
|
||||
- name: Upload Release
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
@@ -390,20 +376,6 @@ jobs:
|
||||
echo "VERSION=$(cat package.json | jq '.version' | tr -d '"')" >> $GITHUB_ENV
|
||||
echo "BUILDTIME=$(TZ=Asia/Shanghai date)" >> $GITHUB_ENV
|
||||
|
||||
- name: Remove old assets from release
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
TAG_NAME: ${{ env.TAG_NAME }}
|
||||
run: |
|
||||
VERSION=$(cat package.json | jq -r '.version')
|
||||
assets=$(gh release view "$TAG_NAME" --json assets -q '.assets[].name' || true)
|
||||
for asset in $assets; do
|
||||
if [[ "$asset" != *"$VERSION"* ]]; then
|
||||
echo "Deleting old asset: $asset"
|
||||
gh release delete-asset "$TAG_NAME" "$asset" -y
|
||||
fi
|
||||
done
|
||||
|
||||
- name: Upload Release
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
@@ -501,20 +473,6 @@ jobs:
|
||||
Rename-Item $file.FullName $newName
|
||||
}
|
||||
|
||||
- name: Remove old assets from release
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
TAG_NAME: ${{ env.TAG_NAME }}
|
||||
run: |
|
||||
VERSION=$(cat package.json | jq -r '.version')
|
||||
assets=$(gh release view "$TAG_NAME" --json assets -q '.assets[].name' || true)
|
||||
for asset in $assets; do
|
||||
if [[ "$asset" != *"$VERSION"* ]]; then
|
||||
echo "Deleting old asset: $asset"
|
||||
gh release delete-asset "$TAG_NAME" "$asset" -y
|
||||
fi
|
||||
done
|
||||
|
||||
- name: Upload Release
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
|
||||
Reference in New Issue
Block a user