Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 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
Expand Down
94 changes: 94 additions & 0 deletions .github/workflows/release-automation.yml
Original file line number Diff line number Diff line change
@@ -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
65 changes: 34 additions & 31 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on:
tags:
- 'v*'

permissions:
contents: write

jobs:
create-release:
name: Create Release
Expand Down Expand Up @@ -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
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 }}"
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 1 addition & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
# **WordPress Symlink Manager for LocalWP**

<!--
GitHub Actions status badges (will be active after workflows are committed):
[![ShellCheck](https://github.com/ericrasch/script-reset-wp-symlinks/actions/workflows/shellcheck.yml/badge.svg)](https://github.com/ericrasch/script-reset-wp-symlinks/actions/workflows/shellcheck.yml)
[![Test Scripts](https://github.com/ericrasch/script-reset-wp-symlinks/actions/workflows/test-scripts.yml/badge.svg)](https://github.com/ericrasch/script-reset-wp-symlinks/actions/workflows/test-scripts.yml)
[![Documentation Check](https://github.com/ericrasch/script-reset-wp-symlinks/actions/workflows/docs-check.yml/badge.svg)](https://github.com/ericrasch/script-reset-wp-symlinks/actions/workflows/docs-check.yml)
[![Security Scan](https://github.com/ericrasch/script-reset-wp-symlinks/actions/workflows/security.yml/badge.svg)](https://github.com/ericrasch/script-reset-wp-symlinks/actions/workflows/security.yml)
-->

## **Overview**

Expand Down Expand Up @@ -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
```

Expand Down Expand Up @@ -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
```
```
Loading