Skip to content

Change zip naming

Change zip naming #2

Workflow file for this run

name: Release
on:
push:
branches:
- dev
paths:
- 'document/**'
- '.github/workflows/release.yml'
- 'deploy.py'
env:
ZIP_BASE_FILENAME: ps5-exploit-host
ZIP_CACHED_SUFFIX: _appcache
ZIP_UNCACHED_SUFFIX: _no-appcache
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 0 # So that we can get the commit count
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Define global "COMMIT_COUNT" variable
id: commit_count
run: echo "COMMIT_COUNT=$(git rev-list --count HEAD)" >> $GITHUB_ENV
- name: Generate uncached ZIP
run: |
python deploy.py --no-appcache --version $COMMIT_COUNT
cd document/en/ps5
zip -r ../../../$ZIP_BASE_FILENAME$ZIP_UNCACHED_SUFFIX.zip *
- name: Generate cached ZIP
run: |
python deploy.py --appcache --version $COMMIT_COUNT
cd document/en/ps5
zip -r ../../../$ZIP_BASE_FILENAME$ZIP_CACHED_SUFFIX.zip *
- name: Delete old latest release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# Ignore error if release does not exist
gh release delete latest --yes || true
- name: Reset tag
run: |
git tag -d latest || true
git push origin :refs/tags/latest || true
- name: Create new release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create latest --latest $ZIP_BASE_FILENAME$ZIP_CACHED_SUFFIX.zip $ZIP_BASE_FILENAME$ZIP_UNCACHED_SUFFIX.zip --title "v1.$COMMIT_COUNT"