diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 65feb6c..dcfce53 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,7 +4,7 @@ name: CI on: pull_request: - branches: [master, development] + branches: [main, development] workflow_dispatch: permissions: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c497498..5dd5fe9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,5 +1,5 @@ -# Release: on every push to master, builds Release and pushes the DSoft.*.nupkg -# package (with its .snupkg symbols) to nuget.org as 4.0.yyMM., then +# Release: on every push to main, builds Release and pushes the DSoft.*.nupkg +# package (with its .snupkg symbols) to nuget.org as 4.0.yyMM., then # tags the commit and creates a GitHub release with the package attached. # RELEASE_SUFFIX is empty for a stable version; set it to a suffix such as # '-prerelease' to publish a prerelease. @@ -8,7 +8,7 @@ name: Release on: push: - branches: [master] + branches: [main] paths-ignore: - '**.md' - '.github/workflows/**' @@ -42,7 +42,10 @@ jobs: id: version shell: bash run: | - version="4.0.$(date -u +%y%m).${{ github.run_number }}" + # The run number is offset by 100 so the first GitHub release sorts above 4.0.2610.91, the + # last version Azure Pipelines published. The run number never resets, so the offset is + # permanent and harmless. + version="4.0.$(date -u +%y%m).$(( ${{ github.run_number }} + 100 ))" echo "version=$version" >> "$GITHUB_OUTPUT" echo "package=$version$RELEASE_SUFFIX" >> "$GITHUB_OUTPUT" echo "Version: $version$RELEASE_SUFFIX" diff --git a/DSoft.System.BluetoothLe/DSoft.System.BluetoothLe.csproj b/DSoft.System.BluetoothLe/DSoft.System.BluetoothLe.csproj index aae1ef9..b101dab 100644 --- a/DSoft.System.BluetoothLe/DSoft.System.BluetoothLe.csproj +++ b/DSoft.System.BluetoothLe/DSoft.System.BluetoothLe.csproj @@ -125,7 +125,7 @@ true true snupkg - true + true diff --git a/README.md b/README.md index bdbe61c..05071ea 100644 --- a/README.md +++ b/README.md @@ -247,8 +247,8 @@ remaining seven target frameworks build and the two Windows ones are skipped. GitHub Actions (`.github/workflows/`): -- `ci.yml`: runs on pull requests to `master` and `development`. Builds Release for every target framework. Publishes nothing. -- `release.yml`: runs on every push to `master` (changes only to Markdown or workflow files are skipped; run it by hand to test a workflow change). Builds Release as `4.0.yyMM.` plus `RELEASE_SUFFIX` (empty for a stable version; set it to `-prerelease` in the workflow to publish a prerelease), uploads the package as the `drop` artifact and pushes it to nuget.org with Trusted Publishing (OIDC, `NUGET_USER` secret, `nuget` environment), then tags the commit `v` and creates a GitHub release with the package attached. `AssemblyVersion` is not stamped by CI: it stays pinned in the project file (see "Strong naming"). +- `ci.yml`: runs on pull requests to `main` and `development`. Builds Release for every target framework. Publishes nothing. +- `release.yml`: runs on every push to `main` (changes only to Markdown or workflow files are skipped; run it by hand to test a workflow change). Builds Release as `4.0.yyMM.` plus `RELEASE_SUFFIX` (empty for a stable version; set it to `-prerelease` in the workflow to publish a prerelease), uploads the package as the `drop` artifact and pushes it to nuget.org with Trusted Publishing (OIDC, `NUGET_USER` secret, `nuget` environment), then tags the commit `v` and creates a GitHub release with the package attached. `AssemblyVersion` is not stamped by CI: it stays pinned in the project file (see "Strong naming"). ### Strong naming