Refactor release workflow for zip creation and upload #2
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build and attach release zip | |
| on: | |
| push: | |
| tags: | |
| - 'v*' | |
| jobs: | |
| build-release-zip: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Create release zip | |
| run: | | |
| set -e | |
| VERSION="${GITHUB_REF_NAME}" | |
| ZIP="one-shot-migrate-${VERSION}.zip" | |
| # Create dist directory first | |
| mkdir -p dist | |
| # Create temp folder structure for proper zip naming | |
| mkdir -p temp/one-shot-migrate | |
| # Copy files (excluding git/github/temp/dist) | |
| rsync -av --exclude='.git' --exclude='.github' --exclude='temp' --exclude='dist' . temp/one-shot-migrate/ | |
| # Create zip from temp directory | |
| cd temp | |
| zip -r "../dist/${ZIP}" one-shot-migrate | |
| - name: Create GitHub Release and upload asset | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| set -e | |
| VERSION="${GITHUB_REF_NAME}" | |
| ZIP="one-shot-migrate-${VERSION}.zip" | |
| gh release create "${VERSION}" "dist/${ZIP}" --title "${VERSION}" --notes-file "RELEASE_NOTES.md" || \ | |
| gh release upload "${VERSION}" "dist/${ZIP}" --clobber |