-
Notifications
You must be signed in to change notification settings - Fork 581
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update GHA for NuGet publishing (#1406)
* Update GHA for NuGet publishing Follow-up to #1398 * Only build RabbitMQ.Client for the publish nuget step, and only push version 7 and higher * Enable RABBITMQ_LONG_RUNNING_TESTS in GHA
- Loading branch information
1 parent
4b3e1ff
commit d786db1
Showing
12 changed files
with
188 additions
and
161 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
{ | ||
"erlang": "26.1.1", | ||
"erlang": "26.1.2", | ||
"rabbitmq": "3.12.6" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
name: build/test rabbitmq-dotnet-client | ||
|
||
on: | ||
- workflow_call | ||
|
||
jobs: | ||
build-win32: | ||
name: build/test on windows-latest | ||
runs-on: windows-latest | ||
# https://github.com/NuGet/Home/issues/11548 | ||
env: | ||
NUGET_CERT_REVOCATION_MODE: offline | ||
steps: | ||
- name: Clone repository | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
- name: Cache installers | ||
uses: actions/cache@v3 | ||
with: | ||
# Note: the cache path is relative to the workspace directory | ||
# https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#using-the-cache-action | ||
path: ~/installers | ||
key: ${{ runner.os }}-v0-${{ hashFiles('.ci/versions.json') }} | ||
- name: Cache NuGet packages | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.nuget/packages | ||
~/AppData/Local/NuGet/v3-cache | ||
key: ${{ runner.os }}-v1-nuget-${{ hashFiles('**/*.csproj') }} | ||
restore-keys: | | ||
${{ runner.os }}-v1-nuget- | ||
- name: Install and Start RabbitMQ | ||
run: .\.ci\windows\gha-setup.ps1 | ||
- name: List NuGet sources | ||
run: dotnet nuget locals all --list | ||
- name: Build | ||
run: dotnet build ${{ github.workspace }}\Build.csproj | ||
- name: Verify | ||
run: dotnet format ${{ github.workspace }}\RabbitMQDotNetClient.sln --verify-no-changes --verbosity=diagnostic | ||
- name: Test | ||
run: .\.ci\windows\gha-run-tests.ps1 | ||
- name: Maybe upload RabbitMQ logs | ||
if: failure() | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: rabbitmq-logs | ||
path: ~/AppData/Roaming/RabbitMQ/log/ | ||
build: | ||
name: build/test on ubuntu-latest | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Clone repository | ||
uses: actions/checkout@v4 | ||
with: | ||
submodules: true | ||
- name: Setup .NET | ||
uses: actions/setup-dotnet@v3 | ||
with: | ||
dotnet-version: 6.x | ||
- name: Cache NuGet packages | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.nuget/packages | ||
~/.local/share/NuGet/v3-cache | ||
key: ${{ runner.os }}-v1-nuget-${{ hashFiles('**/*.csproj') }} | ||
restore-keys: | | ||
${{ runner.os }}-v1-nuget- | ||
- name: Start RabbitMQ | ||
id: start-rabbitmq | ||
run: ${{ github.workspace }}/.ci/ubuntu/gha-setup.sh | ||
- name: List NuGet sources | ||
run: dotnet nuget locals all --list | ||
- name: Build | ||
run: dotnet build ${{ github.workspace }}/Build.csproj | ||
- name: Verify | ||
run: dotnet format ${{ github.workspace }}/RabbitMQDotNetClient.sln --verify-no-changes --verbosity=diagnostic | ||
- name: Test | ||
run: | | ||
dotnet test \ | ||
--environment "RABBITMQ_RABBITMQCTL_PATH=DOCKER:${{ steps.start-rabbitmq.outputs.id }}" \ | ||
--environment 'RABBITMQ_LONG_RUNNING_TESTS=true' \ | ||
--environment 'PASSWORD=grapefruit' \ | ||
--environment SSL_CERTS_DIR="${{ github.workspace }}/.ci/certs" \ | ||
"${{ github.workspace }}/projects/Unit/Unit.csproj" --no-restore --no-build --logger 'console;verbosity=detailed' --framework 'net6.0' | ||
- name: Maybe upload RabbitMQ logs | ||
if: failure() | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: rabbitmq-logs | ||
path: ${{ github.workspace }}/.ci/ubuntu/log/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: publish-nuget | ||
|
||
on: | ||
workflow_call: | ||
secrets: | ||
NUGET_API_KEY: | ||
required: true | ||
|
||
jobs: | ||
publish-nuget: | ||
runs-on: windows-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.nuget/packages | ||
~/.local/share/NuGet/v3-cache | ||
key: ${{ runner.os }}-v1-nuget-${{ hashFiles('**/*.csproj') }} | ||
restore-keys: | | ||
${{ runner.os }}-v1-nuget- | ||
- name: Build (Release) | ||
run: dotnet build ${{ github.workspace }}\projects\RabbitMQ.Client\RabbitMQ.Client.csproj --verbosity=normal --configuration=Release --property CI=true | ||
- name: Publish to NuGet | ||
run: dotnet nuget push --skip-duplicate --api-key ${{ secrets.NUGET_API_KEY }} --source 'https://api.nuget.org/v3/index.json' ${{ github.workspace }}\packages\RabbitMQ.Client.7.*.nupkg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
name: publish rabbitmq-dotnet-client | ||
|
||
on: | ||
release: | ||
types: | ||
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#release | ||
- published | ||
|
||
jobs: | ||
call-build-test: | ||
uses: ./.github/workflows/build-test.yaml | ||
call-publish-nuget: | ||
uses: ./.github/workflows/publish-nuget.yaml | ||
needs: call-build-test | ||
secrets: inherit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.