Skip to content

Refactor release workflow for zip creation and upload #2

Refactor release workflow for zip creation and upload

Refactor release workflow for zip creation and upload #2

Workflow file for this run

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