diff --git a/.github/workflows/ts-sdk.yml b/.github/workflows/ts-sdk.yml index a88f606..e7dc5c0 100644 --- a/.github/workflows/ts-sdk.yml +++ b/.github/workflows/ts-sdk.yml @@ -11,10 +11,6 @@ on: jobs: release: runs-on: ubuntu-latest - - permissions: - contents: read - id-token: write steps: - name: Checkout repo @@ -23,51 +19,12 @@ jobs: - name: Setup node uses: actions/setup-node@v3 - # - name: Download Fern - # run: npm install -g fern-api - - # - name: Publish to NPM - # env: - # FERN_TOKEN: ${{ secrets.FERN_TOKEN }} - # NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - # run: | - # fern generate --group node-sdk --version ${{ inputs.version }} --log-level debug + - name: Download Fern + run: npm install -g fern-api - # - uses: actions/checkout@v4 - # with: - # # Repository name with owner. For example, actions/checkout - # # Default: ${{ github.repository }} - # repository: 'hookdeck/hookdeck-typescript-sdk.git' - # path: 'hookdeck-typescript-sdk' - # ref: 'main' - # token: ${{ secrets.GH_ACCESS_TOKEN }} - - - name: Clone hookdeck-typescript-sdk for JSR + - name: Publish to NPM + env: + FERN_TOKEN: ${{ secrets.FERN_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} run: | - git clone https://oauth2:${{ secrets.GH_ACCESS_TOKEN }}:@github.com/hookdeck/hookdeck-typescript-sdk.git - git remote set-url --push origin https://oauth2:${{ secrets.GH_ACCESS_TOKEN }}:@github.com/hookdeck/hookdeck-typescript-sdk.git - - - - name: Update jsr.json version - uses: jossef/action-set-json-field@v2.1 - with: - file: './hookdeck-typescript-sdk/jsr.json' - field: version - value: ${{ inputs.version }} - - - name: Commit jsr.json - run: | - cd hookdeck-typescript-sdk - git config --local user.email "info@hookdeck.com" - git config --local user.name "GitHub Action" - git add -A - git commit -m "docs: updating JSR release ${{ inputs.version }}" - - - name: Push jsr.json changes - uses: ad-m/github-push-action@v0.6.0 - with: - github_token: ${{ github.token }} - tags: true - - - name: Publish to JSR.io - run: npx jsr publish + fern generate --group node-sdk --version ${{ inputs.version }} --log-level debug