diff --git a/.github/workflows/README.md b/.github/workflows/README.md index 4982b92701..5617e76024 100644 --- a/.github/workflows/README.md +++ b/.github/workflows/README.md @@ -48,33 +48,17 @@ The repository uses multiple GitHub Actions workflows. What runs and when: 3. Runs IntegrationTests with diagnostic output 4. Uploads logs per-OS -### 4) Create Release (`.github/workflows/release.yml`) - -- **Triggers**: `workflow_dispatch` (manual trigger from GitHub Actions UI) -- **Inputs**: - - `release_type`: Choose from `beta`, `rc`, or `stable` - - `version_override`: (Optional) Specify exact version number, otherwise GitVersion calculates it -- **Process**: - 1. Checks out `main` branch - 2. Determines version using GitVersion or override - 3. Creates annotated git tag (e.g., `v2.0.1-rc.1` or `v2.1.0`) - 4. Creates release commit with message - 5. Pushes tag and commit to repository - 6. Creates GitHub Release (marked as pre-release if not stable) - 7. Automatically triggers publish workflow (see below) -- **Purpose**: Automates the release process to prevent manual errors - -### 5) Publish to NuGet (`.github/workflows/publish.yml`) +### 4) Publish to NuGet (`.github/workflows/publish.yml`) - **Triggers**: push to `develop` and tags `v*` (ignores `**.md`) - Uses GitVersion to compute SemVer, builds Release, packs Terminal.Gui and Terminal.Gui.Interop.Spectre with symbols, and pushes both to NuGet.org using `NUGET_API_KEY` -- **Automatically triggered** by the Create Release workflow when a new tag is pushed +- **Automatically triggered** when a `v*` tag is pushed — typically by the **Finalize Release** workflow after a release PR (from **Prepare Release**) is merged into `main` - **Additional actions on tag push** (`v*`): - Triggers Terminal.Gui.templates repository update via repository_dispatch (requires `TEMPLATE_REPO_TOKEN` secret) -### 6) Build and publish API docs (`.github/workflows/api-docs.yml`) +### 5) Build and publish API docs (`.github/workflows/api-docs.yml`) -- **Triggers**: push to `main` +- **Triggers**: push to `develop`, and `workflow_dispatch` - Builds DocFX site on Windows and deploys to GitHub Pages diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index e48d1f2e38..0000000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,144 +0,0 @@ -name: Create Release - -on: - workflow_dispatch: - inputs: - release_type: - description: 'Release type' - required: true - type: choice - options: - - prealpha - - alpha - - beta - - rc - - stable - default: 'beta' - version_override: - description: 'Version override (optional, e.g., 2.0.0). If not provided, GitVersion will calculate it.' - required: false - type: string - -jobs: - create-release: - name: Create and Tag Release - runs-on: ubuntu-latest - permissions: - contents: write - - steps: - - name: Checkout main - uses: actions/checkout@v7 - with: - ref: main - fetch-depth: 0 - token: ${{ secrets.GITHUB_TOKEN }} - - - name: Configure Git - run: | - git config user.name "github-actions[bot]" - git config user.email "github-actions[bot]@users.noreply.github.com" - - - name: Install GitVersion - uses: gittools/actions/gitversion/setup@v4.5.0 - with: - versionSpec: '6.0.x' - - - name: Determine Version - uses: gittools/actions/gitversion/execute@v4.5.0 - with: - useConfigFile: true - updateAssemblyInfo: true - id: gitversion - - - name: Prepare Release Variables - id: prepare - run: | - if [ -n "${{ github.event.inputs.version_override }}" ]; then - VERSION="${{ github.event.inputs.version_override }}" - else - VERSION="${{ steps.gitversion.outputs.MajorMinorPatch }}" - fi - - RELEASE_TYPE="${{ github.event.inputs.release_type }}" - - if [ "$RELEASE_TYPE" = "stable" ]; then - TAG="v${VERSION}" - RELEASE_NAME="v${VERSION}" - else - TAG="v${VERSION}-${RELEASE_TYPE}" - RELEASE_NAME="v${VERSION}-${RELEASE_TYPE}" - fi - - echo "version=${VERSION}" >> $GITHUB_OUTPUT - echo "tag=${TAG}" >> $GITHUB_OUTPUT - echo "release_name=${RELEASE_NAME}" >> $GITHUB_OUTPUT - echo "release_type=${RELEASE_TYPE}" >> $GITHUB_OUTPUT - - - name: Check if tag already exists - run: | - if git rev-parse "${{ steps.prepare.outputs.tag }}" >/dev/null 2>&1; then - echo "::error::Tag ${{ steps.prepare.outputs.tag }} already exists in the repository." - echo "::error::To resolve this:" - echo "::error:: - Choose a different version number, or" - echo "::error:: - Delete the existing tag if this is intentional: git push --delete origin ${{ steps.prepare.outputs.tag }}" - exit 1 - fi - - - name: Create Release Tag - run: | - # Create tag first to match the original manual release script behavior - # Note: This means the tag points to the commit before the release commit - git tag -a "${{ steps.prepare.outputs.tag }}" -m "Release ${{ steps.prepare.outputs.release_name }}" - echo "Created tag: ${{ steps.prepare.outputs.tag }}" - - - name: Create Release Commit - run: | - git commit --allow-empty -m "Release ${{ steps.prepare.outputs.release_name }}" - echo "Created release commit" - - - name: Push Changes - run: | - git push origin main - git push origin "${{ steps.prepare.outputs.tag }}" - echo "Pushed branch and tag to origin" - - - name: Create GitHub Release - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - RELEASE_NAME: ${{ steps.prepare.outputs.release_name }} - VERSION: ${{ steps.prepare.outputs.version }} - RELEASE_TYPE: ${{ steps.prepare.outputs.release_type }} - TAG: ${{ steps.prepare.outputs.tag }} - run: | - PRERELEASE_FLAG="" - if [ "$RELEASE_TYPE" != "stable" ]; then - PRERELEASE_FLAG="--prerelease" - fi - - # Create release notes - cat > /tmp/release_notes.md << EOF - Release ${RELEASE_NAME} - - This release was created automatically using the release workflow. - - - **Version:** ${VERSION} - - **Type:** ${RELEASE_TYPE} - - The package will be automatically published to NuGet.org via the publish workflow. - EOF - - gh release create "$TAG" \ - --title "$RELEASE_NAME" \ - $PRERELEASE_FLAG \ - --notes-file /tmp/release_notes.md - - - name: Summary - run: | - echo "## Release Created Successfully! :rocket:" >> $GITHUB_STEP_SUMMARY - echo "" >> $GITHUB_STEP_SUMMARY - echo "- **Tag:** ${{ steps.prepare.outputs.tag }}" >> $GITHUB_STEP_SUMMARY - echo "- **Version:** ${{ steps.prepare.outputs.version }}" >> $GITHUB_STEP_SUMMARY - echo "- **Type:** ${{ steps.prepare.outputs.release_type }}" >> $GITHUB_STEP_SUMMARY - echo "" >> $GITHUB_STEP_SUMMARY - echo "The publish workflow will automatically build and publish this release to NuGet.org." >> $GITHUB_STEP_SUMMARY diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index aa962c6a98..6449f2f275 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -336,23 +336,21 @@ foreach (Rune rune in text.EnumerateRunes ()) ### Automated Release Workflow -Releases are now automated using GitHub Actions to prevent manual errors. To create a release: +Releases are automated using GitHub Actions to prevent manual errors. The flow is PR-based: **Prepare Release** opens a release PR from `develop` → `main`, and merging it runs **Finalize Release**. To create a release: 1. **Navigate to Actions tab** in the GitHub repository -2. **Select "Create Release" workflow** from the left sidebar +2. **Select "Prepare Release" workflow** from the left sidebar 3. **Click "Run workflow"** button 4. **Configure release parameters:** - - **Branch:** Ensure `main` is selected - - **Release type:** Choose from `prealpha`, `alpha`, `beta`, `rc`, or `stable` + - **Release type:** Choose from `beta`, `rc`, or `stable` - **Version override:** (Optional) Specify exact version (e.g., `2.0.0`), otherwise GitVersion calculates it automatically -5. **Click "Run workflow"** to start the automated release process - -The workflow will: -- Create an annotated git tag (e.g., `v2.0.0-prealpha` or `v2.0.0`) -- Create a release commit on `main` -- Push the tag and commit to the repository -- Create a GitHub Release -- Automatically trigger the publish workflow to push the package to NuGet.org +5. **Click "Run workflow"** to create the release PR + +Prepare Release creates a `release/` branch — where `` is the full version tag, e.g. `release/v2.0.0` for a stable release or `release/v2.0.0-beta.1` for a pre-release — with the GitVersion label updated for the release type, and opens a PR into `main`. After CI passes, **review and merge that PR**. Merging triggers **Finalize Release**, which: +- Creates an annotated git tag (e.g., `v2.0.0-beta.1` or `v2.0.0`) +- Creates a GitHub Release with auto-generated notes +- Opens a back-merge PR from `main` → `develop` +- Triggers the publish workflow (via the `v*` tag) to push the package to NuGet.org ## What NOT to Do diff --git a/Terminal.Gui/README.md b/Terminal.Gui/README.md index a2deae60dc..283ec00a4a 100644 --- a/Terminal.Gui/README.md +++ b/Terminal.Gui/README.md @@ -51,7 +51,7 @@ Two workflows handle the release lifecycle: **Step 1 — [Prepare Release](../.github/workflows/prepare-release.yml)** (manual trigger): 1. Go to **Actions → Prepare Release → Run workflow**. 2. Pick the release type (`beta`, `rc`, `stable`) and optionally override the version. -3. The workflow creates a `release/vX.Y.Z` branch from `develop`, updates the `GitVersion.yml` label, and opens a PR into `main`. +3. The workflow creates a `release/` branch from `develop` — where `` is the full version tag, e.g. `release/v2.0.0` or `release/v2.0.0-beta.1` — updates the `GitVersion.yml` label, and opens a PR into `main`. 4. Review the PR — CI runs, branch protections apply. **Step 2 — [Finalize Release](../.github/workflows/finalize-release.yml)** (automatic on PR merge): @@ -110,8 +110,7 @@ All workflows are in [`.github/workflows/`](../.github/workflows/): |----------|---------|---------| | **[prepare-release.yml](../.github/workflows/prepare-release.yml)** | Manual dispatch | Creates a release PR from `develop` → `main` with label updates | | **[finalize-release.yml](../.github/workflows/finalize-release.yml)** | Release PR merged to `main` | Creates tag, GitHub Release, back-merge PR to `develop` | -| **[publish.yml](../.github/workflows/publish.yml)** | Push to `main` or `develop`, version tags | Builds Release config, packs, and publishes to NuGet.org | -| **[release.yml](../.github/workflows/release.yml)** | Manual dispatch | **(Legacy)** Direct tag-and-release on `main`; superseded by prepare/finalize | +| **[publish.yml](../.github/workflows/publish.yml)** | Push to `develop`, or `v*` tags | Builds Release config, packs, and publishes to NuGet.org | | **[build-validation.yml](../.github/workflows/build-validation.yml)** | Push/PR to `main` or `develop` | Builds all configurations to validate compilation | | **[unit-tests.yml](../.github/workflows/unit-tests.yml)** | Push/PR to `main` or `develop` | Runs all unit tests | | **[api-docs.yml](../.github/workflows/api-docs.yml)** | Push to `develop` | Builds and deploys API docs to GitHub Pages | @@ -135,7 +134,7 @@ These branches are **not** configured in `GitVersion.yml` (the config was remove ## NuGet Package - **Package**: [nuget.org/packages/Terminal.Gui](https://www.nuget.org/packages/Terminal.Gui) -- **Auto-published** on every push to `main` or `develop` (pre-release versions from `develop`, stable versions from `main`) +- **Auto-published** on every push to `develop` (pre-release versions) and on `v*` tag pushes (stable/pre-release versions tagged on `main`) - Pre-release versions (e.g., `2.1.0-develop.42`) are marked as pre-release on NuGet ### Local Package Development @@ -154,7 +153,7 @@ dotnet build Terminal.Gui/Terminal.Gui.csproj -c Release - **Live docs**: [tui-cs.github.io/Terminal.Gui](https://tui-cs.github.io/Terminal.Gui) - **DocFX source**: [`docfx/`](../docfx/) — see [`docfx/README.md`](../docfx/README.md) for local generation -- **API docs** are auto-deployed to GitHub Pages on every push to `main` +- **API docs** are auto-deployed to GitHub Pages on every push to `develop` ## Contributing diff --git a/Terminal.slnx b/Terminal.slnx index db03cfdc59..6a1b34315d 100644 --- a/Terminal.slnx +++ b/Terminal.slnx @@ -64,7 +64,6 @@ -