From 64692c442adaf08d00eaadfcb8ca2820a433cb15 Mon Sep 17 00:00:00 2001 From: Eric Rasch Date: Fri, 27 Jun 2025 22:38:45 -0500 Subject: [PATCH 1/2] Add release automation workflow and update release process documentation - Introduced `release-automation.yml` for manual release preparation with changelog updates. - Enhanced `release.yml` to utilize GitHub CLI for creating releases. - Updated `README.md` to include detailed release process instructions. - Modified `CHANGELOG.md` to reflect recent fixes and removals. --- .github/workflows/README.md | 62 ++++++++++++++++ .github/workflows/release-automation.yml | 94 ++++++++++++++++++++++++ .github/workflows/release.yml | 65 ++++++++-------- CHANGELOG.md | 13 ++++ 4 files changed, 203 insertions(+), 31 deletions(-) create mode 100644 .github/workflows/release-automation.yml diff --git a/.github/workflows/README.md b/.github/workflows/README.md index 87a5a58..56afb62 100644 --- a/.github/workflows/README.md +++ b/.github/workflows/README.md @@ -43,6 +43,14 @@ This directory contains automated workflows for the WordPress Symlink Manager re - Release notes generation - Installation instructions +### 📦 **Release Automation** (`release-automation.yml`) +- **Triggers**: Manual workflow dispatch +- **Purpose**: Prepare releases with changelog updates +- **Features**: + - Creates release branch + - Updates CHANGELOG.md template + - Opens PR for review + ## Configuration Files - `markdown-link-check-config.json` - Link checker configuration @@ -85,6 +93,60 @@ act -j shellcheck act push ``` +## Release Process + +### Creating a New Release + +1. **Start the release process**: + - Go to the [Actions tab](../../actions) on GitHub + - Click on "Release Automation" in the left sidebar + - Click "Run workflow" + - Enter the new version number (e.g., `2.1.2`) + - Select the release type (patch/minor/major) + - Click "Run workflow" + +2. **Update the changelog**: + - A PR will be created automatically with a CHANGELOG.md template + - Edit the PR to fill in the actual changes under the appropriate sections: + - `### Added` - for new features + - `### Changed` - for changes in existing functionality + - `### Fixed` - for bug fixes + - `### Removed` - for removed features + - Remove any empty sections + - Review and merge the PR + +3. **Create and push the tag**: + ```bash + # After merging the PR, pull the latest changes + git pull origin main + + # Create and push the tag (replace X.Y.Z with your version) + git tag -a vX.Y.Z -m "Release vX.Y.Z" + git push origin vX.Y.Z + ``` + +4. **Automatic release creation**: + - The `release.yml` workflow will automatically: + - Extract the changelog for this version + - Create a GitHub release with the changelog + - Add installation instructions + +### Quick Release (for patch versions) + +For simple patch releases with just bug fixes: + +```bash +# Make sure you're on main and up to date +git checkout main +git pull origin main + +# Tag and push (the release will be created automatically) +git tag -a v2.1.2 -m "Fix: Brief description of fixes" +git push origin v2.1.2 +``` + +**Note**: Remember to update CHANGELOG.md manually after the release if you use the quick method. + ## Maintenance - Review workflow efficiency monthly diff --git a/.github/workflows/release-automation.yml b/.github/workflows/release-automation.yml new file mode 100644 index 0000000..c15a7e3 --- /dev/null +++ b/.github/workflows/release-automation.yml @@ -0,0 +1,94 @@ +name: Release Automation + +on: + workflow_dispatch: + inputs: + version: + description: 'Version number (e.g., 2.1.2)' + required: true + type: string + release_type: + description: 'Release type' + required: true + type: choice + options: + - patch + - minor + - major + +permissions: + contents: write + pull-requests: write + +jobs: + prepare-release: + name: Prepare Release + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Configure Git + run: | + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + + - name: Update CHANGELOG + run: | + # Get the current date + DATE=$(date +%Y-%m-%d) + VERSION="${{ inputs.version }}" + + # Create a placeholder for the new version entry + NEW_ENTRY="## [$VERSION] - $DATE + +### Added + +- + +### Changed + +- + +### Fixed + +- + +### Removed + +- + +" + + # Insert the new entry after the header + awk '/^## \[/ && !done {print "'"$NEW_ENTRY"'"; done=1} 1' CHANGELOG.md > CHANGELOG.tmp + mv CHANGELOG.tmp CHANGELOG.md + + echo "::notice::Please update CHANGELOG.md with the actual changes for version $VERSION" + + - name: Create Pull Request + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + BRANCH="release/v${{ inputs.version }}" + git checkout -b "$BRANCH" + git add CHANGELOG.md + git commit -m "Prepare release v${{ inputs.version }}" + git push origin "$BRANCH" + + gh pr create \ + --title "Release v${{ inputs.version }}" \ + --body "## Release Checklist + +- [ ] Update CHANGELOG.md with all changes +- [ ] Run all tests locally +- [ ] Verify all GitHub Actions pass +- [ ] Review documentation for accuracy + +## Version: v${{ inputs.version }} +Type: ${{ inputs.release_type }} + +Once this PR is merged, the release will be created automatically via the tag push." \ + --base main \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 748ad4f..6744186 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,6 +5,9 @@ on: tags: - 'v*' +permissions: + contents: write + jobs: create-release: name: Create Release @@ -34,36 +37,36 @@ jobs: fi - name: Create Release - uses: actions/create-release@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: ${{ github.ref }} - release_name: WordPress Symlink Manager v${{ steps.changelog.outputs.version }} - body: | - ## Changes - - ${{ steps.changelog.outputs.changelog }} - - ## Installation - - ```bash - # Clone the repository - git clone https://github.com/${{ github.repository }}.git - cd $(basename ${{ github.repository }}) - - # Install dependencies - brew install jq - - # Run the interactive menu - ./wp-symlinks - ``` - - ## Verification - - You can verify the release integrity by checking the commit hash: - ``` - git log --oneline | head -5 - ``` - draft: false - prerelease: false \ No newline at end of file + run: | + gh release create "${{ github.ref_name }}" \ + --title "WordPress Symlink Manager ${{ github.ref_name }}" \ + --notes "## Changes + +${{ steps.changelog.outputs.changelog }} + +## Installation + +\`\`\`bash +# Clone the repository +git clone https://github.com/${{ github.repository }}.git +cd $(basename ${{ github.repository }}) + +# Install dependencies +brew install jq + +# Run the interactive menu +./wp-symlinks +\`\`\` + +## Verification + +You can verify the release integrity by checking the commit hash: +\`\`\` +git log --oneline | head -5 +\`\`\` + +--- + +**Full Changelog**: https://github.com/${{ github.repository }}/compare/v2.1.0...${{ github.ref_name }}" \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 16e8741..f1135e0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,19 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [2.1.1] - 2025-06-28 + +### Fixed + +- **Shellcheck warnings** - Fixed unused variable warnings across all scripts +- **Documentation consistency** - Corrected script path references in README.md +- **GitHub Actions** - Fixed SecurityScan workflow trufflehog configuration +- **Markdown formatting** - Fixed linting issues in all documentation files + +### Removed + +- **Obsolete references** - Removed all mentions of non-existent `wp-symlinks-nocolor` + ## [2.1.0] - 2025-06-27 ### Changed From 598d0ce08d12da8be551af7b8f8d02fee92941cf Mon Sep 17 00:00:00 2001 From: Eric Rasch Date: Fri, 27 Jun 2025 22:49:13 -0500 Subject: [PATCH 2/2] Update README to remove commented-out GitHub Actions badges and improve clarity --- .github/workflows/README.md | 2 +- README.md | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/README.md b/.github/workflows/README.md index 56afb62..a42ccbc 100644 --- a/.github/workflows/README.md +++ b/.github/workflows/README.md @@ -98,7 +98,7 @@ act push ### Creating a New Release 1. **Start the release process**: - - Go to the [Actions tab](../../actions) on GitHub + - Go to the Actions tab on GitHub - Click on "Release Automation" in the left sidebar - Click "Run workflow" - Enter the new version number (e.g., `2.1.2`) diff --git a/README.md b/README.md index 6a1c0c7..70bebcd 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,9 @@ # **WordPress Symlink Manager for LocalWP** - ## **Overview** @@ -68,7 +65,6 @@ Your workspace will contain: ├── symlink-config.json # Your personalized configuration (auto-generated!) ├── backups/ # Automatic backups directory ├── WORKSPACE-README.md # Quick reference guide -├── setup-aliases.sh # Optional shell aliases └── documentation files ``` @@ -275,4 +271,4 @@ This project is licensed under the **MIT License**. You are free to use, modify, 6) View current configuration 7) Restore from backup 8) View backup list -``` \ No newline at end of file +```