Skip to content

Commit

Permalink
content_check
Browse files Browse the repository at this point in the history
  • Loading branch information
Incpi committed Sep 23, 2024
1 parent 98b0bc1 commit b178030
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest

permissions:
contents: write
contents: write

steps:
- name: Checkout repository
Expand Down Expand Up @@ -55,12 +55,10 @@ jobs:
- name: Delete old zip asset if it exists
if: env.RELEASE_EXISTS == 'true'
run: |
ASSETS=$(gh release view "v${{ env.VERSION }}" --json assets --jq '.assets[] | select(.name == "${{ env.ZIP_BASENAME }}") | .id')
if [ -n "$ASSETS" ]; then
echo "Deleting old asset: $ASSETS"
for ASSET_ID in $ASSETS; do
gh release delete-asset "${{ env.RELEASE_ID }}" "$ASSET_ID"
done
ASSET_ID=$(gh release view "v${{ env.VERSION }}" --json assets --jq '.assets[] | select(.name == "${{ env.ZIP_BASENAME }}") | .id')
if [ -n "$ASSET_ID" ]; then
echo "Deleting old asset: $ASSET_ID"
gh api repos/:owner/:repo/releases/assets/$ASSET_ID -X DELETE
else
echo "No old asset found to delete."
fi
Expand All @@ -76,14 +74,14 @@ jobs:
body: "Release created/updated with version ${{ env.VERSION }}"
draft: false
prerelease: false
overwrite: true # Overwrite the release if it exists
overwrite: true # Overwrite the release if it exists

- name: Attach zip file with clean name to release
- name: Attach new zip file to release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_or_update_release.outputs.upload_url }}
asset_path: ${{ env.ZIP_FILE }} # Full path to the zip file
asset_name: ${{ env.ZIP_BASENAME }} # Clean zip file name without the path
asset_path: ${{ env.ZIP_FILE }} # Full path to the zip file
asset_name: ${{ env.ZIP_BASENAME }} # Use the same zip file name
asset_content_type: application/zip
Binary file modified bin/Dark-CPI_Extension@v1.3.5.zip
Binary file not shown.

0 comments on commit b178030

Please sign in to comment.