Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
93 changes: 93 additions & 0 deletions .github/workflows/publish-client.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
name: Publish client

on:
workflow_dispatch:
workflow_run:
workflows: ["Release"]
branches: ["main"]
types:
- completed
Comment thread
JanCizmar marked this conversation as resolved.
pull_request:

# Trusted Publishers for npm via GitHub Actions OIDC
permissions:
id-token: write
contents: read

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: "24"
registry-url: "https://registry.npmjs.org"

- 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: machine@tolgee.io
GIT_COMMITTER_EMAIL: machine@tolgee.io

- 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

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

- name: Pull newest schema
run: npm run schema
working-directory: ./client
env:
TOLGEE_API_PORT: "8201"

- 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 version >/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 --provenance
fi
working-directory: ./client
Comment thread
stepan662 marked this conversation as resolved.

- 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 version >/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 --provenance
fi
working-directory: ./client
Comment thread
stepan662 marked this conversation as resolved.
28 changes: 28 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -519,13 +519,37 @@ jobs:
run: npm run eslint
working-directory: ./email

client-checks:
name: Client tests & build 📦
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4

- name: Setup environment
uses: ./.github/actions/setup-env
with:
java: 'false'

- name: Install dependencies
run: npm ci
working-directory: ./client

- name: Build
run: npm run build
working-directory: ./client

- name: Test
run: npm test
working-directory: ./client

everything-passed:
name: Everything passed 🎉
needs:
- backend-build
- backend-test
- backend-code-checks
- email-code-checks
- client-checks
- frontend-build
- frontend-code-check
- frontend-test
Expand Down Expand Up @@ -594,6 +618,10 @@ jobs:
failed_jobs+=("email-code-checks")
fi

if [[ "${{ needs.client-checks.result }}" != "success" ]]; then
failed_jobs+=("client-checks")
fi

if [[ "${#failed_jobs[@]}" -gt 0 ]]; then
echo "The following jobs failed: ${failed_jobs[*]}"
exit 1
Expand Down
2 changes: 2 additions & 0 deletions backend/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,8 @@ dependencies {
testImplementation('io.netty:netty-codec-http:4.2.5.Final')
testImplementation('io.netty:netty-codec-http2:4.2.5.Final')
testImplementation('io.netty:netty-handler:4.2.5.Final')
testImplementation('io.swagger.parser.v3:swagger-parser:2.1.20')
testImplementation('com.networknt:json-schema-validator:2.0.0')
ktlint(project(":ktlint"))


Expand Down
Loading
Loading