Skip to content

Update Full Repository Zip #15

Update Full Repository Zip

Update Full Repository Zip #15

name: Update Full Repository Zip
on:
push:
branches: ["main"]
workflow_dispatch:
jobs:
update-zip:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository with full history
uses: actions/checkout@v5
with:
ref: main
fetch-depth: 0 # This ensures we get the full git history
- name: Create zip file with full git history
run: |
# Create a zip file containing the entire repository including .git folder
# zip -r tts-webui-installer.zip . -x "node_modules/*" "installer_files/*" "*.pyc" "__pycache__/*"
zip -r tts-webui-installer.zip .
- name: Delete existing asset if it exists
uses: actions/github-script@v6
continue-on-error: true
with:
script: |
// Get the latest release
const { data: release } = await github.rest.repos.getLatestRelease({
owner: context.repo.owner,
repo: context.repo.repo
});
const assets = release.assets;
const assetName = 'tts-webui-installer.zip';
for (const asset of assets) {
if (asset.name === assetName) {
console.log(`Deleting existing asset: ${asset.name} (${asset.id})`);
await github.rest.repos.deleteReleaseAsset({
owner: context.repo.owner,
repo: context.repo.repo,
asset_id: asset.id
});
break;
}
}
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Upload ZIP to GitHub Release
uses: softprops/action-gh-release@v2
with:
files: tts-webui-installer.zip
tag_name: v0.0.0
token: ${{ secrets.GITHUB_TOKEN }}