Skip to content

Commit

Permalink
GitHub actions updates (#162)
Browse files Browse the repository at this point in the history
* Bump RabbitMQ and Erlang versions on Windows
* Move CI specific files to `.ci/`
* Only publish to NuGet when a GitHub release or pre-release is published

Bump actions resource versions

Update release process documentation

Co-authored-by: Gabriele Santomaggio <[email protected]>
  • Loading branch information
lukebakken and Gsantomaggio authored Sep 5, 2022
1 parent 2b5177b commit 9e3e4f7
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 27 deletions.
2 changes: 1 addition & 1 deletion tools/install.ps1 → .ci/install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Set-StrictMode -Version 2.0

[Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor 'Tls12'

$versions_path = Join-Path -Path $env:GITHUB_WORKSPACE -ChildPath 'tools' | Join-Path -ChildPath 'versions.json'
$versions_path = Join-Path -Path $env:GITHUB_WORKSPACE -ChildPath '.ci' | Join-Path -ChildPath 'versions.json'
$versions = Get-Content $versions_path | ConvertFrom-Json
Write-Host "[INFO] versions: $versions"
$erlang_ver = $versions.erlang
Expand Down
4 changes: 4 additions & 0 deletions .ci/versions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"erlang": "25.0.4",
"rabbitmq": "3.10.7"
}
18 changes: 9 additions & 9 deletions .github/workflows/build-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@ jobs:
name: build/test on windows-latest
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-dotnet@v1
- uses: actions/checkout@v3
- uses: actions/setup-dotnet@v2
with:
dotnet-version: 6.0.x
- uses: actions/cache@v2
- 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 }}-v1-${{ hashFiles('tools/versions.json') }}
- uses: actions/cache@v2
key: ${{ runner.os }}-v1-${{ hashFiles('.ci/versions.json') }}
- uses: actions/cache@v3
with:
path: |
~/.nuget/packages
Expand All @@ -27,7 +27,7 @@ jobs:
restore-keys: |
${{ runner.os }}-v2-nuget-
- name: Install and start RabbitMQ
run: ./tools/install.ps1
run: ./.ci/install.ps1
- name: Restore
run: dotnet restore --verbosity=normal
- name: Build
Expand All @@ -51,11 +51,11 @@ jobs:
- 1883:1883
- 61613:61613
steps:
- uses: actions/checkout@v2
- uses: actions/setup-dotnet@v1
- uses: actions/checkout@v3
- uses: actions/setup-dotnet@v2
with:
dotnet-version: 6.0.x
- uses: actions/cache@v2
- uses: actions/cache@v3
with:
path: |
~/.nuget/packages
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/publish-nuget.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ jobs:
publish-nuget:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-dotnet@v1
- uses: actions/checkout@v3
- uses: actions/setup-dotnet@v2
with:
dotnet-version: 6.0.x
- uses: actions/cache@v2
- uses: actions/cache@v3
with:
path: |
~/.nuget/packages
Expand Down
12 changes: 4 additions & 8 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
name: publish rabbitmq-stream-dotnet-client

on:
create:
branches-ignore:
- '*'
tags:
- '*'
push:
tags:
- '*'
release:
types:
# https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#release
- published

jobs:
call-build-test:
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -616,10 +616,10 @@ The client is work in progress. The API(s) could change prior to version `1.0.0`
* Ensure builds are green: [link](https://github.com/rabbitmq/rabbitmq-stream-dotnet-client/actions)
* Tag the `main` branch using your GPG key:
```
git tag -a -s -u GPG_KEY_ID -m 'rabbitmq-stream-dotnet-client v1.0.0-beta.6' 'v1.0.0-beta.6' && git push && git push --tags
git tag -a -s -u GPG_KEY_ID -m 'rabbitmq-stream-dotnet-client v1.0.0' 'v1.0.0' && git push && git push --tags
```
* Ensure the build for the tag passes: [link](https://github.com/rabbitmq/rabbitmq-stream-dotnet-client/actions)
* Create the new release on GitHub, which triggers a build and publish to NuGet: [link](https://github.com/rabbitmq/rabbitmq-stream-dotnet-client/releases)
* Check for the new version on NuGet: [link](https://www.nuget.org/packages/RabbitMQ.Stream.Client)
* Best practice is to download the new package and inspect the contents using [NuGetPackageExplorer](https://github.com/NuGetPackageExplorer/NuGetPackageExplorer)
* Create the new release on GitHub: [link](https://github.com/rabbitmq/rabbitmq-stream-dotnet-client/releases)
* Announce the new release on the mailing list: [link](https://groups.google.com/g/rabbitmq-users)
4 changes: 0 additions & 4 deletions tools/versions.json

This file was deleted.

0 comments on commit 9e3e4f7

Please sign in to comment.