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
20 changes: 20 additions & 0 deletions .github/workflows/lint-pr-title.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Lint PR Title

on:
pull_request_target:
types:
- opened
- edited
- synchronize

permissions:
pull-requests: read

jobs:
lint_title:
name: Validate PR title
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@e32d7e603df1aa1ba07e981f2a23455dee596825 # v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
29 changes: 29 additions & 0 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Release Please

on:
push:
branches:
- main

concurrency:
group: release-please
cancel-in-progress: false

permissions:
contents: write
pull-requests: write

jobs:
release-please:
runs-on: ubuntu-latest
steps:
- name: Generate token
id: generate-token
uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2.2.1
with:
app-id: ${{ vars.SDK_BOT_APP_ID }}
private-key: ${{ secrets.SDK_BOT_PRIVATE_KEY }}

- uses: googleapis/release-please-action@16a9c90856f42705d54a6fda1823352bdc62cf38 # v4.4.0
with:
token: ${{ steps.generate-token.outputs.token }}
26 changes: 17 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
name: Release

on:
# Support manually pushing a new release
workflow_dispatch: {}
# Trigger when a release is published
workflow_dispatch:
Comment on lines 1 to +4
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

workflow_dispatch publishes from current branch state, not a specific release tag

When this workflow is triggered manually via workflow_dispatch, it checks out the default branch at HEAD — whatever version happens to be in WorkOS.net.csproj at that moment. This is different from the release: [published] path where GITHUB_SHA is pinned to the release tag commit.

This means a manual trigger at the wrong time (e.g., after release-please has bumped the version in a release PR that hasn't been merged yet) could publish a version that doesn't correspond to any tag or release, making it hard to trace what source code was published.

Consider adding an explicit ref input to gate which commit gets published:

workflow_dispatch:
  inputs:
    ref:
      description: 'Git ref (tag or SHA) to publish'
      required: true
      default: 'main'

Then use ref: ${{ inputs.ref }} in the actions/checkout step.

release:
types: [released]
types: [published]

defaults:
run:
shell: bash

jobs:
test:
publish:
name: Publish to NuGet
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps:
# TODO: Remove libssl1.1 installation once we drop support for .NET Core 3.1
- name: Install libssl1.1 for .NET Core 3.1
Expand All @@ -29,9 +30,16 @@ jobs:
dotnet-version: |
3.1.x

- name: Build
run: dotnet pack -c Release src/WorkOS.net/WorkOS.net.csproj

- name: NuGet login (trusted publishing)
id: login
uses: NuGet/login@d22cc5f58ff5b88bf9bd452535b4335137e24544 # v1.1.0
with:
user: workos

- name: Publish
run: dotnet nuget push src/WorkOS.net/bin/Release/WorkOS.net.*.nupkg --api-key "$NUGET_API_KEY" --source https://api.nuget.org/v3/index.json --skip-duplicate
env:
DOTNET_NUGET_API_KEY: ${{ secrets.DOTNET_NUGET_API_KEY }}
run: |
dotnet pack -c Release src/WorkOS.net/WorkOS.net.csproj
dotnet nuget push src/WorkOS.net/bin/Release/WorkOS.net.*.nupkg -s https://api.nuget.org/v3/index.json --skip-duplicate -k $DOTNET_NUGET_API_KEY
NUGET_API_KEY: ${{ steps.login.outputs.NUGET_API_KEY }}
3 changes: 3 additions & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
".": "2.10.1"
}
14 changes: 14 additions & 0 deletions release-please-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
"packages": {
".": {
"release-type": "simple",
"package-name": "WorkOS.net",
"include-component-in-tag": false,
"extra-files": [
"src/WorkOS.net/WorkOS.net.csproj"
],
"changelog-path": "CHANGELOG.md"
}
}
}
4 changes: 2 additions & 2 deletions src/WorkOS.net/WorkOS.net.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
<SignAssembly>True</SignAssembly>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<VersionPrefix>2.10.1</VersionPrefix>
<Version>2.10.1</Version>
<VersionPrefix>2.10.1</VersionPrefix> <!--x-release-please-version -->
<Version>2.10.1</Version> <!--x-release-please-version -->
</PropertyGroup>

<ItemGroup>
Expand Down
Loading