Skip to content

Commit

Permalink
chore: Canary Release (#45)
Browse files Browse the repository at this point in the history
* chore: fix tsconfig

* chore: remove d.ts.map files from packages

* chore: add changesets

* chore: add pr

* chore: add auth token

* fix tests for now

* chore: fix setup

* do not fail for no files

* fix typo

* show npmrc contents

* add registry url

* change version

* hopefully this isn’t over engineered

* fix

* try private

* try quotes

* add declaration map

* fix build

* remove pr event

---------

Co-authored-by: deekshas8 <[email protected]>
  • Loading branch information
marikaner and deekshas8 authored Aug 6, 2024
1 parent 0f34a86 commit 17321ce
Show file tree
Hide file tree
Showing 10 changed files with 643 additions and 19 deletions.
11 changes: 11 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [["@sap-ai-sdk/*"]],
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
27 changes: 27 additions & 0 deletions .github/workflows/delete-dist-tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: delete-dist-tag

on:
workflow_dispatch:
inputs:
tag:
description: 'Dist tag to delete.'
type: string
required: true

jobs:
publish:
runs-on: ubuntu-latest

steps:
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
registry-url: 'https://registry.npmjs.org'
cache: 'pnpm'

- name: delete dist tag
run: |
npm dist-tag rm @sap-ai-sdk/gen-ai-hub ${{ inputs.tag }}
npm dist-tag rm @sap-ai-sdk/ai-core ${{ inputs.tag }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPMJS_ACCESS_TOKEN }}
52 changes: 52 additions & 0 deletions .github/workflows/publish-canary.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: publish-canary

on:
schedule:
- cron: '0 1 * * *'
workflow_dispatch:
inputs:
tag:
description: 'Dist tag for the release. If you chose something different than "canary", make sure to delete it once it is not needed anymore.'
type: string
required: false
default: 'canary'

jobs:
publish:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v3
with:
version: ${{ vars.PNPM_VERSION }}
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
registry-url: 'https://registry.npmjs.org'
cache: 'pnpm'

- name: install and build
run: pnpm install

- name: prepare canary changeset
run: |
rm -f .changeset/*.md || true
cat <<EOT >> .changeset/canary-release-changeset.md
---
'@sap-ai-sdk/ai-core': patch
'@sap-ai-sdk/gen-ai-hub': patch
---
Canary release
EOT
- name: publish
run: |
date=`date +%Y%m%d%H%M%S`
pnpm changeset pre enter ${date}
pnpm changeset version
pnpm changeset pre exit
pnpm changeset publish --tag ${{ inputs.tag }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPMJS_ACCESS_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,4 @@ build/Release
.env
.env.test
.env.local
/pnpm-publish-summary.json
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sap-ai-sdk",
"version": "0.0.1",
"version": "0.0.0",
"description": "",
"keywords": [],
"license": "Apache-2.0",
Expand All @@ -20,6 +20,7 @@
"lint:fix": "pnpm -r run lint:fix"
},
"devDependencies": {
"@changesets/cli": "^2.27.7",
"@sap-cloud-sdk/eslint-config": "^3.17.0",
"@sap-cloud-sdk/connectivity": "^3.17.0",
"@sap-cloud-sdk/http-client": "^3.17.0",
Expand All @@ -31,7 +32,7 @@
"prettier": "^3.3.3",
"ts-jest": "^29.2.4",
"ts-node": "^10.9.2",
"typescript": "^5.5.4",
"tsd": "^0.31.0"
"tsd": "^0.31.0",
"typescript": "^5.5.4"
}
}
3 changes: 1 addition & 2 deletions packages/ai-core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sap-ai-sdk/ai-core",
"version": "0.0.1",
"version": "0.0.0",
"description": "",
"license": "Apache-2.0",
"keywords": [
Expand All @@ -23,7 +23,6 @@
"lint:fix": "eslint . --fix && prettier . --config ../../.prettierrc --ignore-path ../../.prettierignore -w --log-level error"
},
"dependencies": {
"@sap-cloud-sdk/connectivity": "^3.17.0",
"@sap-cloud-sdk/openapi": "^3.17.0"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/gen-ai-hub/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sap-ai-sdk/gen-ai-hub",
"version": "0.0.1",
"version": "0.0.0",
"description": "",
"license": "Apache-2.0",
"keywords": [
Expand Down
Loading

0 comments on commit 17321ce

Please sign in to comment.