Skip to content
Closed
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
1 change: 1 addition & 0 deletions .config/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
GITHUB_TOKEN=
4 changes: 4 additions & 0 deletions .config/husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn commit message lint
4 changes: 4 additions & 0 deletions .config/husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn commit staged
4 changes: 4 additions & 0 deletions .config/husky/prepare-commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn commit message $@
51 changes: 51 additions & 0 deletions .github/ISSUE_TEMPLATE/bug.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Bug
description: Что-то где-то сдохло
labels: ['bug']
assignees:
- TorinAsakura
body:
- type: textarea
id: bug-description
attributes:
label: Описание бага
validations:
required: true
- type: textarea
id: reproduce
attributes:
label: Воспроизведение
description: 'Шаги для воспроизведения бага:'
placeholder: |
1. Идём туда-то **package/name/src/main.js:561**
2. Выполнить команду или что-то запустить
3. Видим то-то и то-то
validations:
required: true
- type: textarea
id: expected-behavior
attributes:
label: Ожидаемое поведение
placeholder: 'Чётко и понятно (без "я думал" или "ну, типа и так панятна же…не?") опишите ожидаемое поведение.'
validations:
required: true
- type: textarea
id: assets
attributes:
label: Материалы
description: Прикладываем скриншоты – если ошибка относится к визуальной части и сбор логов не приемлем. Прикладываем логи — если ошибка относится к системной части и скриншот не поможет в анализе и решении проблемы
validations:
required: true
- type: textarea
id: env
attributes:
label: Данные окружения
placeholder: |
- OS и версия [например iOS@14.7, Android@6.7.3, Windows@7.1]
- Браузер и версия [например Chrome@64, Safari@13]
validations:
required: true
- type: input
id: backlink
attributes:
label: Саппорт тикет
placeholder: Приложи ссылку на тикет из саппорта
108 changes: 108 additions & 0 deletions .github/actions/android/prepare/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
name: Prepare gradle.properties file
description: Create gradle.properties file

inputs:
GRADLE_VERSION:
default: '8.5'
description: Gradle version
required: false
PROPERTIES_FILE:
default: gradle.properties
description: Relative file path for putting in secrets
required: false
SIGNING_SECRET_KEY_RING_FILE:
default: com.personaClick.key.gpg
description: Location and name for signature file
required: false
SIGNING_SECRET_KEY_RING_FILE_LOCATION:
description: Location and name for signature file
required: true
default: ./personalization-sdk
VARIANT_NAME:
description: PersonaClick or PersonaClick
required: true
URL:
description: GitHub repo URL
required: true
MAVEN_REPOSITORY_URL:
description: Maven repository publish to
required: true
OSSRH_USERNAME:
description: ossrhUsername
required: true
SONATA_USERNAME:
description: sonata username
required: true
SONATA_PASSWORD:
description: sonata password
required: true
SONATYPE_PersonaClick:
description: sonatype for personaClick
SONATYPE_PERSONACLICK:
description: sonatype for personaclick
OSSRH_PASSWORD:
description: ossrhPassword
required: true
SIGNING_KEY_ID:
description: Signing key ID
required: true
SIGNING_PASSWORD:
description: Signing key password
required: true
SIGNING_KEY_FILE_AS_BASE64_STRING:
description: Signing key file as base64 string
required: true

runs:
using: composite

steps:
- name: Setup Java
uses: actions/setup-java@v4
with:
java-version: 22
distribution: 'zulu'

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
with:
gradle-version: ${{ inputs.GRADLE_VERSION }}

- name: Append secrets to gradle.properties
shell: bash
env:
PROPERTIES_FILE: ${{ inputs.PROPERTIES_FILE }}
OSSRH_USERNAME: 'github-bot@personaclick.com'
OSSRH_PASSWORD: ${{ inputs.OSSRH_PASSWORD }}
SONATA_USERNAME: ${{ inputs.SONATA_USERNAME }}
SONATA_PASSWORD: ${{ inputs.SONATA_PASSWORD }}
SONATYPE_PersonaClick: ${{ inputs.SONATYPE_PersonaClick }}
SONATYPE_PERSONACLICK: ${{ inputs.SONATYPE_PERSONACLICK }}
SIGNING_KEY_ID: ${{ inputs.SIGNING_KEY_ID }}
SIGNING_PASSWORD: ${{ inputs.SIGNING_PASSWORD }}
SIGNING_SECRET_KEY_RING_FILE: ${{ inputs.SIGNING_SECRET_KEY_RING_FILE }}
VARIANT_NAME: ${{ inputs.VARIANT_NAME }}
URL: ${{ inputs.URL }}
PUBLISH_URL: ${{ inputs.MAVEN_REPOSITORY_URL }}
run: |
echo "ossrhUsername=$OSSRH_USERNAME" >> $PROPERTIES_FILE
echo "ossrhPassword=$OSSRH_PASSWORD" >> $PROPERTIES_FILE
echo "sonataUsername=$SONATA_USERNAME" >> $PROPERTIES_FILE
echo "sonataPassword=$SONATA_PASSWORD" >> $PROPERTIES_FILE
echo "sonatype_personaClick=$SONATYPE_PersonaClick" >> $PROPERTIES_FILE
echo "sonatype_personaclick=$SONATYPE_PERSONACLICK" >> $PROPERTIES_FILE
echo "signing_keyId=$SIGNING_KEY_ID" >> $PROPERTIES_FILE
echo "signing_password=$SIGNING_PASSWORD" >> $PROPERTIES_FILE
echo "signing_secretKeyRingFile=$SIGNING_SECRET_KEY_RING_FILE" >> $PROPERTIES_FILE
echo "variantName=$VARIANT_NAME" >> $PROPERTIES_FILE
echo "url=$URL" >> $PROPERTIES_FILE
echo "publishUrl=$PUBLISH_URL" >> $PROPERTIES_FILE
echo "Updated $PROPERTIES_FILE"

- name: Decode signing key file
uses: timheuer/base64-to-file@v1.2
id: service_account_json_file
with:
fileName: ${{ inputs.SIGNING_SECRET_KEY_RING_FILE }}
fileDir: ${{ inputs.SIGNING_SECRET_KEY_RING_FILE_LOCATION }}
encodedString: ${{ inputs.SIGNING_KEY_FILE_AS_BASE64_STRING }}
58 changes: 58 additions & 0 deletions .github/actions/js/changelog-and-publish-js/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Publish composite action
description: create changelog and publish if applicable

inputs:
onlyChangelog:
required: false
default: 'false'
description: Should only create changelog without publish
npmAuthToken:
required: false
description: NPM token for publishing
token:
required: true
description: GitHub PAT
baseCommit:
required: true
description: Base commit from which to parse workspace changes
exclude:
required: false
description: Which workspaces to exclude
default: 'nothing'
workingDirectory:
required: false
default: ./
description: Where the script runs
registryServer:
required: false
default: 'https://registry.npmjs.org'
description: Where to send the package

runs:
using: composite

steps:
- name: Generate changelog
working-directory: ${{ inputs.workingDirectory }}
env:
GITHUB_TOKEN: ${{ inputs.token }}
BASE_COMMIT: ${{ inputs.baseCommit }}
EXCLUDE: ${{ inputs.exclude }}
run: yarn workspaces foreach --since=$BASE_COMMIT^ --exclude=$EXCLUDE -vp --jobs=2 run changelog
shell: bash

- name: Force Yarn to use NPM Registry
run: |
yarn config set npmScopes.personaClick.npmRegistryServer ${{ inputs.registryServer }}
yarn config set npmRegistryServer ${{ inputs.registryServer }}
shell: bash

- name: Publish
if: inputs.onlyChangelog == 'false'
working-directory: ${{ inputs.workingDirectory }}
env:
YARN_NPM_AUTH_TOKEN: ${{ inputs.npmAuthToken }}
BASE_COMMIT: ${{ inputs.baseCommit }}
EXCLUDE: ${{ inputs.exclude }}
run: yarn workspaces foreach --since=$BASE_COMMIT^ --exclude=$EXCLUDE --no-private -vp --jobs=2 npm publish --access public
shell: bash
74 changes: 74 additions & 0 deletions .github/actions/js/commit-js/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Commit changes composite
description: commit made changes

inputs:
token:
description: GitHub PAT
required: true
baseCommit:
description: Base commit to check changes from
required: true
additionalBranch:
description: Additional branch to push to
required: false
default: ''
exclude:
description: Which workspaces to exclude
required: false
default: 'nothing'
workingDirectory:
required: false
default: ./
description: Where the script runs

outputs:
committed:
value: ${{ steps.committer.outputs.committed }}
description: Has the commit been sent? 'true' as string if yes

runs:
using: composite

steps:
- name: Create commit message
working-directory: ${{ inputs.workingDirectory }}
id: commit_message
env:
BASE_COMMIT: ${{ inputs.baseCommit }}
EXCLUDE: ${{ inputs.exclude }}
run: |
INITIAL_MESSAGE=$'chore(common): versions\n\n'
temp_file=$(mktemp)
yarn workspaces foreach --since=$BASE_COMMIT --exclude=$EXCLUDE exec "echo \"\$npm_package_name:\$npm_package_version \" >> $temp_file"
MESSAGE=$(cat $temp_file)
echo $(cat $temp_file)
INITIAL_MESSAGE+=$MESSAGE
INITIAL_MESSAGE="${INITIAL_MESSAGE//'%'/' '}"
INITIAL_MESSAGE="${INITIAL_MESSAGE//$'\n'/' '}"
INITIAL_MESSAGE="${INITIAL_MESSAGE//$'\r'/' '}"
echo "commitMessage=$INITIAL_MESSAGE" >> $GITHUB_OUTPUT
echo $INITIAL_MESSAGE
rm $temp_file
shell: bash

- name: Commit changes
id: committer
uses: planetscale/ghcommit-action@v0.2.0
env:
GITHUB_TOKEN: ${{ inputs.token }}
with:
repo: ${{ github.repository }}
branch: master
commit_message: ${{ steps.commit_message.outputs.commitMessage }}
file_pattern: '*.json *.md *.yaml *.yml *.lock'

- name: Commit changes to additional branch
if: inputs.additionalBranch != ''
uses: planetscale/ghcommit-action@v0.2.0
env:
GITHUB_TOKEN: ${{ inputs.token }}
with:
repo: ${{ github.repository }}
branch: ${{ inputs.additionalBranch }}
commit_message: ${{ steps.commit_message.outputs.commitMessage }}
file_pattern: '*.json *.md *.yaml *.yml *.lock'
46 changes: 46 additions & 0 deletions .github/actions/js/delete-release-js/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Composite delete release JS action
description: Delete release action - delete release because its revert

inputs:
isMonorepo:
required: false
default: 'false'
description: Treat this repo as monorepo. If true - tags for releases will include package names
baseCommit:
required: true
description: Base commit from which to parse changed workspaces
token:
required: true
description: GitHub PAT
exclude:
required: false
default: 'nothing'
description: Which workspaces to exclude
workingDirectory:
required: false
default: ./
description: Where the script runs

runs:
using: composite

steps:
- name: Release monorepo
if: inputs.isMonorepo == 'true'
working-directory: ${{ inputs.workingDirectory }}
env:
BASE_COMMIT: ${{ inputs.baseCommit }}
GH_TOKEN: ${{ inputs.token }}
EXCLUDE: ${{ inputs.exclude }}
run: yarn workspaces foreach --since=$BASE_COMMIT^ --exclude=$EXCLUDE -vp --jobs=2 exec 'bash -c "VERSION=$npm_package_version && NAME=$npm_package_name && gh release delete \"\$NAME-v\$VERSION\" -y --cleanup-tag"'
shell: bash

- name: Release single package
if: inputs.isMonorepo == 'false'
working-directory: ${{ inputs.workingDirectory }}
env:
BASE_COMMIT: ${{ inputs.baseCommit }}
GH_TOKEN: ${{ inputs.token }}
EXCLUDE: ${{ inputs.exclude }}
run: yarn workspaces foreach --since=$BASE_COMMIT^ --exclude=$EXCLUDE -vp --jobs=2 exec 'bash -c "VERSION=$npm_package_version && gh release delete \"v\$VERSION\" -y --cleanup-tag"'
shell: bash
35 changes: 35 additions & 0 deletions .github/actions/js/find-base-commit-js/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Version composite action
description: patch versions of changed packages

inputs:
token:
description: GitHub PAT
required: true
workingDirectory:
required: false
default: ./
description: Where the script runs

outputs:
baseCommit:
description: Find last merge commits
value: ${{ steps.find_base_commit.outputs.baseCommit }}

runs:
using: composite

steps:
- name: Find Base Commit for master
id: find_base_commit
run: |
BASE_COMMIT=$(git log --merges -n 2 --format=format:%H | tail -n 1)
echo "baseCommit=$BASE_COMMIT" >> $GITHUB_OUTPUT
echo "Base Commit: $BASE_COMMIT"
shell: bash

- name: List changed workspaces
working-directory: ${{ inputs.workingDirectory }}
env:
BASE_COMMIT: ${{ steps.find_base_commit.outputs.baseCommit }}
run: yarn workspaces list --since=$BASE_COMMIT^
shell: bash
Loading
Loading