-
-
Notifications
You must be signed in to change notification settings - Fork 304
feat: tolgee platform client #3201
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
stepan662
wants to merge
34
commits into
main
Choose a base branch
from
stepangranat/tolgee-client-lib
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
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 dd26d7c
fix: correct version
stepan662 040af8b
fix: correct version
stepan662 5a4b8cf
fix: correct version
stepan662 0f58885
fix: correct version
stepan662 45c1441
fix: correct version
stepan662 6517f52
fix: correct package.json
stepan662 4f8800b
fix: correct package.json
stepan662 8ce3d27
fix: correct package.json
stepan662 4cbddb7
fix: correct package.json
stepan662 fbc6060
chore: publish only if version already exists
stepan662 3c94c67
chore: publish correct version
stepan662 c8a8f58
feat: move publish client to test folder
stepan662 a9f62aa
chore: fix publish client
stepan662 2a5f754
chore: fix publish client
stepan662 048a427
chore: install dev dependencies
stepan662 f3e8746
chore: fixes
stepan662 9fb708c
chore: export more from client
stepan662 89afde0
chore: add necessary dependency for the client
stepan662 fbd7457
chore: separate publish-client workflow
stepan662 a45c9c1
fix: improved client
stepan662 f0dab67
fix: improve api client
stepan662 665b582
fix: better defaults
stepan662 6abdba9
fix: project id system
stepan662 d6ff7c9
fix: project id number
stepan662 7e03a30
chore: project id
stepan662 f717822
fix: prioritize user token
stepan662 a253dee
chore: handle responses with empty body
stepan662 f8cbfdc
chore: test
stepan662 cc62582
chore: update stuff from coderabbit
stepan662 3dbf1df
chore: remove accidental dependency
stepan662 334db19
chore: fixes
stepan662 3eac9ec
fix: tsconfig
stepan662 9a376f9
fix: fix api client types
stepan662 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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 | ||
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 | ||
stepan662 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
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 | ||
stepan662 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
env: | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,7 +52,7 @@ jobs: | |
- name: Setup environment | ||
uses: ./.github/actions/setup-env | ||
with: | ||
node: 'false' | ||
node: "false" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 | ||
|
@@ -202,7 +202,7 @@ jobs: | |
- name: Setup environment | ||
uses: ./.github/actions/setup-env | ||
with: | ||
java: 'false' | ||
java: "false" | ||
|
||
- name: Install dependencies | ||
run: npm ci | ||
|
@@ -251,7 +251,7 @@ jobs: | |
- name: Setup environment | ||
uses: ./.github/actions/setup-env | ||
with: | ||
java: 'false' | ||
java: "false" | ||
|
||
- name: Install dependencies | ||
run: npm ci | ||
|
@@ -274,7 +274,7 @@ jobs: | |
- name: Setup environment | ||
uses: ./.github/actions/setup-env | ||
with: | ||
java: 'false' | ||
java: "false" | ||
|
||
- name: Install dependencies | ||
run: npm ci | ||
|
@@ -305,7 +305,7 @@ jobs: | |
- name: Setup environment | ||
uses: ./.github/actions/setup-env | ||
with: | ||
node: 'false' | ||
node: "false" | ||
|
||
- name: Run ktlint | ||
run: ./gradlew ktlintCheck | ||
|
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
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? |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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.