Skip to content

Commit

Permalink
fix: Release typescript action version (#1663)
Browse files Browse the repository at this point in the history
Co-authored-by: fundthmcalculus <fundthmcalculus@users.noreply.github.com>
  • Loading branch information
fundthmcalculus and fundthmcalculus committed Jun 12, 2024
1 parent 67192b5 commit d2e7856
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 17 deletions.
8 changes: 0 additions & 8 deletions .github/workflows/build-connect-typescript.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ on:

jobs:
build_test:
strategy:
matrix:
swagger_json: ['connect/swagger_api.json']
language: [['typescript-fetch', 'connect/typescript']]
name: Build
runs-on: ubuntu-latest
steps:
Expand All @@ -26,10 +22,6 @@ jobs:
cache: 'npm'

- name: Build Connect TypeScript SDK
run: ./connect/make-swagger.ps1 -language ${{ matrix.language[0] }} -swaggerFile ${{ matrix.swagger_json }} -outputFolder ${{ matrix.language[1] }}
shell: pwsh

- name: Build and format
run: ./.github/workflows/connect/build-typescript.ps1
shell: pwsh

Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/connect/build-typescript.ps1
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Regenerate the swagger too
Set-Location $PSScriptRoot/../../../
&./connect/make-swagger.ps1 -language "typescript-fetch" -swaggerFile "connect/swagger_api.json" -outputFolder 'connect/typescript'
Set-Location $PSScriptRoot/../../../connect/typescript
# Run the build script
npm ci
Expand Down
17 changes: 17 additions & 0 deletions .github/workflows/connect/release-typescript.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Ensure the NODE_AUTH_TOKEN is set in the environment variables of the repository.
# ${{ secrets.NPM_TOKEN }} is the secret name for the NPM_TOKEN
param(
[string]$NpmToken = $env:NPM_TOKEN,
[string]$NodeAuthToken = $env:NODE_AUTH_TOKEN
)

Set-Location $PSScriptRoot/../../../connect/typescript

# Set env vars
$env:NODE_AUTH_TOKEN = $NodeAuthToken
$env:NPM_TOKEN = $NpmToken

npm set //registry.npmjs.org/:_authToken $NpmToken
npm ci
npm run build
npm publish --no-git-tag-version --yes --no-verify-access
5 changes: 5 additions & 0 deletions .github/workflows/connect/set-connect-version.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,11 @@ if ($Version -eq "NEXTPATCH") {
$Version = "0.0.1"
}

# HACK typescript or typescript-fetch are the same thing!
if ($Language -eq "typescript") {
$Language = "typescript-fetch"
}


Write-Host "Setting version to $Version for $Language, IncrementPatch: $IncrementPatch"

Expand Down
17 changes: 9 additions & 8 deletions .github/workflows/release-connect-typescript.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,20 @@ jobs:
name: npmjs.com
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v2
- uses: actions/setup-node@v3
with:
dotnet-version: '8.0.x'
node-version: '20'
registry-url: 'https://registry.npmjs.org'
- name: Set version
run: ./.github/workflows/connect/set-connect-version.ps1 -Version ${{ github.event.inputs.packageVersion || 'NEXTPATCH' }} -Language "typescript"
shell: pwsh
- run: npm set //registry.npmjs.org/:_authToken ${{ secrets.NPM_TOKEN }}
- run: |
npm ci
npm run build
npm publish --no-git-tag-version --yes --no-verify-access
working-directory: ./connect/typescript
- name: Build!
run: ./.github/workflows/connect/build-typescript.ps1
shell: pwsh
- run: ./.github/workflows/connect/release-typescript.ps1
shell: pwsh
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Mewmba Create PR
Expand Down
2 changes: 1 addition & 1 deletion connect/dotnet/src/Trinsic.Connect/Client/ApiClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ private static HttpContent PrepareMultipartFormDataContent(RequestOptions option
}
}
}


_ = new List<Tuple<HttpContent, string, string>>();

string contentType = null;
Expand Down

0 comments on commit d2e7856

Please sign in to comment.