Skip to content

Commit

Permalink
Introduce publishing workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
haysch committed Mar 5, 2025
1 parent 2fe37d7 commit ea46a76
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Publish SDK packages
on:
release:
types: [published]
permissions:
contents: read
id-token: write
jobs:
nodejs-publish:
runs-on: ubuntu-latest
defaults:
run:
working-directory: packages/nodejs
steps:
- uses: actions/checkout@v4
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@v4
with:
node-version: '16.x'
registry-url: 'https://registry.npmjs.org'
- run: npm ci
- run: npm run test:unit
- run: npm publish --provenance
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

csharp-publish:
runs-on: ubuntu-latest
defaults:
run:
working-directory: packages/dotnet
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
dotnet-version: |
7.0.x
8.0.x
- run: dotnet test
working-directory: Criipto.Signatures.UnitTests
- run: dotnet pack -c Release Criipto.Signatures
- run: dotnet nuget push Criipto.Signatures/bin/Release/Criipto.Signatures.*.nupkg --api-key ${{ secrets.NUGET_TOKEN }} --source https://api.nuget.org/v3/index.json
17 changes: 17 additions & 0 deletions RELEASING.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Releasing

Releasing a new version of the SDKs are divided in two steps:

1. Tag changes
2. Create release

The process aims to eliminate human interaction and reduce point-of-failures (or rather, remember what to do and when).

## Tagging

After having merged new commits - either via PR or directly on default branch - run the following NPM scripts on default branch to publish new version tags:

```sh
Expand All @@ -9,3 +18,11 @@ npm run tag

The commit log should now contain the updated `Criipto.Signatures.csproj` and `package.json` version.
When the commit log is satisfying, the version commit and tags can then be pushed by `npm run tag:post`, which ensures that the commits and tag is pushed to remote.

## Create release

Whenever the changes have been tagged and is ready to be released, a release needs to be created in GitHub, which in turn will perform the necessary steps to push the SDKs to their respective package sources.

The release changelog **should** contain the changes in a presentable fashion to help the users understand the update.

The [`publish.yml` workflow](.github/workflows/publish.yml) takes care of the necessary technicalities.

0 comments on commit ea46a76

Please sign in to comment.