Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
db0231c
feat: tolgee platform client
stepan662 Aug 13, 2025
dd26d7c
fix: correct version
stepan662 Aug 13, 2025
040af8b
fix: correct version
stepan662 Aug 13, 2025
5a4b8cf
fix: correct version
stepan662 Aug 13, 2025
0f58885
fix: correct version
stepan662 Aug 13, 2025
45c1441
fix: correct version
stepan662 Aug 13, 2025
6517f52
fix: correct package.json
stepan662 Aug 13, 2025
4f8800b
fix: correct package.json
stepan662 Aug 13, 2025
8ce3d27
fix: correct package.json
stepan662 Aug 13, 2025
4cbddb7
fix: correct package.json
stepan662 Aug 13, 2025
fbc6060
chore: publish only if version already exists
stepan662 Aug 13, 2025
3c94c67
chore: publish correct version
stepan662 Aug 13, 2025
c8a8f58
feat: move publish client to test folder
stepan662 Aug 13, 2025
a9f62aa
chore: fix publish client
stepan662 Aug 13, 2025
2a5f754
chore: fix publish client
stepan662 Aug 13, 2025
048a427
chore: install dev dependencies
stepan662 Aug 13, 2025
f3e8746
chore: fixes
stepan662 Aug 13, 2025
9fb708c
chore: export more from client
stepan662 Aug 13, 2025
89afde0
chore: add necessary dependency for the client
stepan662 Aug 13, 2025
fbd7457
chore: separate publish-client workflow
stepan662 Aug 14, 2025
a45c9c1
fix: improved client
stepan662 Aug 15, 2025
f0dab67
fix: improve api client
stepan662 Aug 15, 2025
665b582
fix: better defaults
stepan662 Aug 15, 2025
6abdba9
fix: project id system
stepan662 Aug 15, 2025
d6ff7c9
fix: project id number
stepan662 Aug 15, 2025
7e03a30
chore: project id
stepan662 Aug 15, 2025
f717822
fix: prioritize user token
stepan662 Aug 15, 2025
a253dee
chore: handle responses with empty body
stepan662 Aug 15, 2025
f8cbfdc
chore: test
stepan662 Aug 15, 2025
cc62582
chore: update stuff from coderabbit
stepan662 Aug 15, 2025
3dbf1df
chore: remove accidental dependency
stepan662 Aug 15, 2025
334db19
chore: fixes
stepan662 Aug 15, 2025
3eac9ec
fix: tsconfig
stepan662 Aug 15, 2025
9a376f9
fix: fix api client types
stepan662 Aug 15, 2025
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
91 changes: 91 additions & 0 deletions .github/workflows/publish-client.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: Publish client

on:
workflow_dispatch:
workflow_run:
workflows: ["Test"]
branches: ["main"]
types:
- completed
Copy link
Contributor

Choose a reason for hiding this comment

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

Probably should be released when release (not the "Test" one) workflow is completed successfully.

pull_request:

jobs:
publish-client:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
token: "${{ secrets.TOLGEE_MACHINE_PAT }}"

- name: Setup node
uses: actions/setup-node@v4
with:
node-version: "22.x"

- name: Install node modules
run: npm ci

- name: Run get new version
run: npm run release-dry
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GIT_AUTHOR_NAME: Tolgee Machine
GIT_COMMITTER_NAME: Tolgee Machine
GIT_AUTHOR_EMAIL: [email protected]
GIT_COMMITTER_EMAIL: [email protected]

- name: Set version property
id: version
run: echo "VERSION=$(test -e .VERSION && echo v$(cat .VERSION))" >> $GITHUB_OUTPUT

- name: Start backend server
uses: nick-fields/retry@v2
with:
timeout_minutes: 30
max_attempts: ${{ github.event_name == 'push' && 5 || 1 }}
command: |
./gradlew runDockerE2e -x buildWebapp
- run: echo '//registry.npmjs.org/:_authToken=${NPM_TOKEN}' > ~/.npmrc

# client folder
- name: install npm dependencies
run: npm install
working-directory: ./client

- name: Pull newest schema
run: npm run schema
working-directory: ./client

- name: Publish to latest tag
if: steps.version.outputs.VERSION != ''
run: |
VERSION=${{ steps.version.outputs.VERSION }}
VERSION=${VERSION#v} # Remove 'v' prefix
if npm view @tginternal/client@$VERSION versions --json >/dev/null 2>&1; then
echo "Version $VERSION already exists, skipping publish."
else
npm run update-version -- $VERSION
npm run build
npm run test
npm publish --tag latest
fi
working-directory: ./client
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Publish to prerelease tag
if: steps.version.outputs.VERSION == ''
run: |
VERSION=0.0.0-prerelease.$(git rev-parse --short HEAD)
if npm view @tginternal/client@$VERSION versions --json >/dev/null 2>&1; then
echo "Version $VERSION already exists, skipping publish."
else
npm run update-version -- $VERSION
npm run build
npm run test
npm publish --tag prerelease
fi
working-directory: ./client
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
10 changes: 5 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
- name: Setup environment
uses: ./.github/actions/setup-env
with:
node: 'false'
node: "false"
Copy link
Contributor

Choose a reason for hiding this comment

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

Probably should be reverted. Looks like we have different formatting preferences.


- name: Download backend build result
uses: ./.github/actions/download-backend-build
Expand Down Expand Up @@ -202,7 +202,7 @@ jobs:
- name: Setup environment
uses: ./.github/actions/setup-env
with:
java: 'false'
java: "false"

- name: Install dependencies
run: npm ci
Expand Down Expand Up @@ -251,7 +251,7 @@ jobs:
- name: Setup environment
uses: ./.github/actions/setup-env
with:
java: 'false'
java: "false"

- name: Install dependencies
run: npm ci
Expand All @@ -274,7 +274,7 @@ jobs:
- name: Setup environment
uses: ./.github/actions/setup-env
with:
java: 'false'
java: "false"

- name: Install dependencies
run: npm ci
Expand Down Expand Up @@ -305,7 +305,7 @@ jobs:
- name: Setup environment
uses: ./.github/actions/setup-env
with:
node: 'false'
node: "false"

- name: Run ktlint
run: ./gradlew ktlintCheck
Expand Down
25 changes: 25 additions & 0 deletions client/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
lib
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
Loading
Loading