Skip to content
Open
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
26 changes: 24 additions & 2 deletions .github/workflows/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
push:
branches: [master]
tags:
- 'v*'
- 'v[0-9]*.[0-9]*.[0-9]*'
workflow_call:
workflow_dispatch:

Expand Down Expand Up @@ -194,11 +194,12 @@ jobs:


publish:
if: startsWith(github.ref, 'refs/tags/')
if: startsWith(github.ref, 'refs/tags/v')
needs: [test-ubuntu, test-windows]
runs-on: windows-latest
permissions:
id-token: write
contents: write

steps:
- uses: actions/checkout@v5
Expand Down Expand Up @@ -236,3 +237,24 @@ jobs:
dotnet nuget push "net_connector/SingleStoreConnector.${{ env.CONNECTOR_VERSION }}.nupkg"
--api-key ${{steps.login.outputs.NUGET_API_KEY}}
--source https://api.nuget.org/v3/index.json

# Extract the notes for this version from docs/VersionHistory.md
- name: Extract release notes
shell: bash
run: |
awk -v ver="### ${CONNECTOR_VERSION}" '
$0 == ver { flag = 1; next }
/^### / && flag { flag = 0 }
flag { print }
' docs/VersionHistory.md > release_notes.md
echo "----- release_notes.md -----"
cat release_notes.md

- name: Create draft GitHub Release
uses: softprops/action-gh-release@v2
with:
draft: true
prerelease: false
name: Release ${{ github.ref_name }}
body_path: release_notes.md
files: net_connector/*
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ dotnet test tests\SingleStoreConnector.Tests

To run the side-by-side tests, see [the instructions](tests/README.md).

## Release process

Releases are automated through GitHub Actions: a new NuGet package is built and published, and a draft GitHub Release is created, whenever a new version tag is pushed to the repository. See [RELEASE.md](RELEASE.md) for the full publishing instructions.

## Goals

The goals of this project are:
Expand Down
71 changes: 71 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
## Release process

`SingleStoreConnector` releases are automated through GitHub Actions. A new NuGet package is built and published automatically when a new version tag is pushed to the GitHub repository.

A draft GitHub Release is also created automatically. The release remains a draft because the release notes must be reviewed and completed manually before publishing.

### Prerequisites

Before creating a release tag:

* Make sure the release changes are merged into the default branch.
* Make sure CI is passing.
* Update `CONNECTOR_VERSION` in `.github/workflows/config.yml` with the new package version.
* Update the connector version in the `README.md` title.
* Add a section for the new version to `docs/VersionHistory.md` describing the changes in this release.
* Make sure the version tag matches the value of `CONNECTOR_VERSION`.
* The version tag must use the `vX.Y.Z` format.

For example, if `CONNECTOR_VERSION` is `1.4.0`, the release tag should be `v1.4.0`.

The version section in `docs/VersionHistory.md` must use a `### X.Y.Z` header that matches `CONNECTOR_VERSION` (for example `### 1.4.0`), because the release workflow extracts that section and uses it to seed the draft GitHub Release notes.

### Creating a release

From the default branch, run:

```bash
git checkout master
git pull origin master
git tag vX.Y.Z
git push origin vX.Y.Z
```

Replace `X.Y.Z` with the version being released.

After the tag is pushed, GitHub Actions will automatically:

1. Run the test workflows.
2. Build the connector.
3. Pack the NuGet package.
4. Publish the `SingleStoreConnector` `.nupkg` package to NuGet.
5. Create a draft GitHub Release for the pushed tag, seeding the release notes from the matching section of `docs/VersionHistory.md` and attaching all build artifacts.

### Verifying the NuGet release

After the release workflow finishes successfully:

1. Check that the GitHub Actions workflow completed without errors.
2. Verify that the new package version is available on [NuGet](https://www.nuget.org/packages/SingleStoreConnector).
3. Optionally install the released package locally:

```bash
dotnet add package SingleStoreConnector --version X.Y.Z
```

### Publishing the GitHub Release

After the workflow creates the draft GitHub Release:

1. Open the repository's Releases page.
2. Open the draft release for the pushed tag, for example `vX.Y.Z`.
3. Review and complete the release notes. They are pre-filled from the matching `docs/VersionHistory.md` section, so verify they are accurate and complete.
4. Publish the GitHub Release.

The GitHub Release is intentionally kept as a draft because it requires complete release notes before publishing.

### Failed releases

If the release workflow fails before publishing to NuGet, fix the issue and rerun the workflow or recreate the tag as needed.

If the package was already published to NuGet, do not reuse the same version number. NuGet package versions are immutable, so a fix must be released with a new version.