Merge pull request #8 from duy-nguyen-van/feature/sdk #1
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release SDKs | |
| on: | |
| push: | |
| tags: | |
| - 'sdk/go/v*' | |
| - 'sdk/typescript/v*' | |
| permissions: | |
| contents: write | |
| packages: write | |
| id-token: write | |
| jobs: | |
| release-go: | |
| if: startsWith(github.ref, 'refs/tags/sdk/go/v') | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version-file: sdk/go/go.mod | |
| - name: Test | |
| run: make sdk-go-test | |
| - name: Create GitHub Release notes | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| name: Go SDK ${{ github.ref_name }} | |
| body: | | |
| Official GateForge IAM Go SDK. | |
| ```bash | |
| go get github.com/gateforge-iam/gateforge-iam/sdk/go@${{ github.ref_name }} | |
| ``` | |
| Module path: `github.com/gateforge-iam/gateforge-iam/sdk/go` | |
| Nested generated client: `github.com/gateforge-iam/gateforge-iam/sdk/go/openapi` | |
| Contract: `api/openapi.yaml` | |
| generate_release_notes: true | |
| release-typescript: | |
| if: startsWith(github.ref, 'refs/tags/sdk/typescript/v') | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 26 | |
| registry-url: https://registry.npmjs.org | |
| cache: npm | |
| cache-dependency-path: sdk/typescript/package-lock.json | |
| - name: Build | |
| working-directory: sdk/typescript | |
| run: | | |
| npm ci | |
| npm test | |
| npm run build | |
| - name: Derive npm version from tag | |
| id: ver | |
| run: | | |
| TAG="${GITHUB_REF_NAME#sdk/typescript/}" | |
| echo "version=${TAG#v}" >> "$GITHUB_OUTPUT" | |
| echo "tag=$TAG" >> "$GITHUB_OUTPUT" | |
| - name: Set package version | |
| working-directory: sdk/typescript | |
| run: npm version "${{ steps.ver.outputs.version }}" --no-git-tag-version | |
| - name: Publish to npm | |
| working-directory: sdk/typescript | |
| run: npm publish --access public | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| - name: Create GitHub Release notes | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| name: TypeScript SDK ${{ github.ref_name }} | |
| body: | | |
| Official GateForge IAM TypeScript SDK (`@gateforge/sdk`). | |
| ```bash | |
| npm install @gateforge/sdk@${{ steps.ver.outputs.version }} | |
| ``` | |
| Contract: `api/openapi.yaml` | |
| generate_release_notes: true |