Compare commits

...

56 Commits

Author SHA1 Message Date
dmitry.aloyan 2756901fd1 fix(werf-deploy): pass NPM_TOKEN into Docker build-args
Reusable workflow callers set env/secrets that never reached `werf
converge`. Accept optional NPM_TOKEN, fall back to Vault, export
WERF_BUILD_ARG_NPM_TOKEN before converge.
2026-08-06 12:22:00 +03:00
dmitry.aloyan 3ffd0bc9c7 fix(plugin/build): enable corepack for Yarn Berry installs 2026-08-05 11:29:19 +00:00
stuart.armstrong 5b2ec5402a Merge pull request 'Use curl to upload.' (#23) from Fix-nexus-upload-step into master
Reviewed-on: #23
2026-07-28 10:42:42 +00:00
stuart.armstrong 0126f2f4d0 Use curl to upload. 2026-07-28 13:40:43 +03:00
stuart.armstrong a57d78d853 Merge pull request 'Test one uplaod.' (#22) from Fix-nexus-upload-step into master
Reviewed-on: #22
2026-07-28 09:48:50 +00:00
stuart.armstrong 396f81c8ae Test one uplaod. 2026-07-28 12:46:42 +03:00
stuart.armstrong dcea56fa54 Merge pull request 'Update node image node:22' (#21) from Update-node-image into master
Reviewed-on: #21
2026-07-27 14:04:47 +00:00
stuart.armstrong b0b40e7b90 Update node image node:22 2026-07-27 17:03:24 +03:00
stuart.armstrong db96c03ac9 Merge pull request 'Enable pnpm in plugins actions' (#20) from Enabled-pnpm-for-plugins-actions into master
Reviewed-on: #20
2026-06-10 11:36:11 +00:00
stuart.armstrong 1f8810c910 Enable pnpm in plugins actions 2026-06-10 14:32:26 +03:00
stuart.armstrong c9c49f3279 Merge pull request 'Fix plugins build ssh-key.' (#19) from Fix-plugins-build-ssh-key into master
Reviewed-on: #19
2026-06-10 11:14:32 +00:00
stuart.armstrong e4b3151427 Fix plugins build ssh-key. 2026-06-10 14:12:18 +03:00
stuart.armstrong 4a9779578c Merge pull request 'Add pnpm version.' (#18) from Template-for-loop-plugin-achievements into master
Reviewed-on: #18
2026-06-03 07:59:11 +00:00
stuart.armstrong 571d7f67ae Add pnpm version. 2026-06-03 10:57:36 +03:00
stuart.armstrong b254c8a0ca Merge pull request 'Add pnpm' (#17) from Template-for-loop-plugin-achievements into master
Reviewed-on: #17
2026-06-03 05:56:12 +00:00
stuart.armstrong e2b7fc1e7e Add pnpm 2026-06-03 08:53:57 +03:00
stuart.armstrong 1a43bb9960 Merge pull request 'Update the achievements plugin action.' (#16) from Template-for-loop-plugin-achievements into master
Reviewed-on: #16
2026-05-25 12:44:31 +00:00
stuart.armstrong a565f36ec7 Update the achievements plugin action. 2026-05-25 15:42:30 +03:00
stuart.armstrong 2662bb6856 Merge pull request 'Add loop-plugin-achievements template' (#15) from Template-for-loop-plugin-achievements into master
Reviewed-on: #15
2026-05-21 08:00:34 +00:00
stuart.armstrong a675c9d772 Add loop-plugin-achievements template 2026-05-21 10:53:28 +03:00
stuart.armstrong c23b92dcc5 Merge pull request 'Add loop-channel-export plugin action' (#14) from loop-plugin-channel-export-template into master
Reviewed-on: #14
2025-10-23 10:56:45 +00:00
stuart.armstrong d105b24d3d Add loop-channel-export plugin action 2025-10-23 13:54:06 +03:00
stuart.armstrong dd556a3bd1 Merge pull request 'Add loop-mobile PR ci test.' (#13) from Loop-mobile-ci-test into master
Reviewed-on: #13
2025-10-13 05:53:53 +00:00
stuart.armstrong b563bfff21 Add loop-mobile PR ci test. 2025-10-13 08:52:26 +03:00
stuart.armstrong 3c5c77baf6 Merge pull request 'Update-marketplace-template' (#12) from Update-marketplace-template into master
Reviewed-on: #12
2025-09-16 06:21:49 +00:00
stuart.armstrong dde9b7de25 Fix. 2025-09-16 09:19:26 +03:00
stuart.armstrong ff9868db80 Add ssh deploykey 2025-09-16 09:18:24 +03:00
artem.drozdov 23e0e9e8b3 revert-ci 2025-06-17 11:29:54 +00:00
artem.drozdov 57b9fc55fb Обновить .gitea/workflows/java-pull-request-check-template.yml 2025-06-17 11:10:37 +00:00
artem.drozdov beb42eccc3 Обновить .gitea/workflows/java-pull-request-check-template.yml 2025-06-17 10:37:56 +00:00
artem.drozdov 623ae7419a Обновить .gitea/workflows/java-pull-request-check-template.yml 2025-06-17 10:33:45 +00:00
artem.drozdov 7ea30bc13f Обновить .gitea/workflows/java-pull-request-check-template.yml 2025-06-17 10:24:20 +00:00
artem.drozdov 33b5813f9b Обновить .gitea/workflows/java-pull-request-check-template.yml 2025-06-17 10:10:58 +00:00
artem.drozdov 0413ac8e1e revert-ci 2025-01-15 13:42:57 +00:00
artem.drozdov ac19e5c216 Обновить .gitea/workflows/werf-yonote-cleanup-template.yml 2025-01-15 13:36:39 +00:00
artem.drozdov edd7dc9be9 Fix-ci-for-cleanup 2025-01-15 13:22:25 +00:00
artem.drozdov 49e4ec8307 add COMMIT_SHA in environment 2025-01-14 15:59:26 +00:00
artem.drozdov 9751c49015 Обновить .gitea/workflows/werf-yonote-cleanup-template.yml 2025-01-14 15:30:53 +00:00
artem.drozdov 86c9097497 Обновить .gitea/workflows/werf-yonote-cleanup-template.yml 2025-01-14 15:00:13 +00:00
artem.drozdov 5014550e10 Merge pull request 'Обновить .gitea/workflows/werf-yonote-cleanup-template.yml' (#11) from fix-cleanup-ci-yonote into master
Reviewed-on: #11
Reviewed-by: Stuart Armstrong <stuart.armstrong@wilix.team>
2025-01-14 13:30:15 +00:00
artem.drozdov 7f5aed727d Обновить .gitea/workflows/werf-yonote-cleanup-template.yml 2025-01-14 13:26:21 +00:00
stuart.armstrong 69d88bed2e Merge pull request 'Cleanup-for-yonote' (#10) from Cleanup-for-yonote into master
Reviewed-on: #10
2024-06-06 05:27:32 +00:00
stuart.armstrong a2d4194b63 Rename 2024-06-06 08:25:58 +03:00
stuart.armstrong 212671a6df Yonote cleanup template. 2024-06-06 08:24:13 +03:00
stuart.armstrong 0267acbfe9 Merge pull request 'Change notify version to fix notifications.' (#9) from Change-mattermost-notify-version-to-fix-notifications into master
Reviewed-on: #9
2024-05-08 06:38:22 +00:00
stuart.armstrong 10607492b5 Change notify version to fix notifications. 2024-05-07 15:06:21 +03:00
stuart.armstrong 7b5c114675 Merge pull request 'actions add yonote check template.' (#8) from Actions-yonote-actions into master
Reviewed-on: #8
2024-01-23 12:59:12 +00:00
stuart.armstrong 21dd806179 actions add yonote check template. 2024-01-23 15:53:24 +03:00
maxim.yanchuk f1c7915415 Merge pull request 'LP-2725: disableable go cache' (#7) from LP-2725 into master
Reviewed-on: #7
2023-12-26 12:24:16 +00:00
maxim.yanchuk b1c60dc122 Merge pull request 'LP-2725: plugin ci template & actions' (#6) from LP-2725 into master
Reviewed-on: #6
2023-12-26 09:25:16 +00:00
stanislav.melnichuk 9e81c6eeb3 Merge pull request 'Actions-add-node-template' (#5) from Actions-add-node-template into master
Reviewed-on: #5
Reviewed-by: Stanislav Melnichuk <s.melnichuk@wilix.org>
2023-12-22 10:30:38 +00:00
stuart.armstrong b42c130ed2 Remove required. 2023-12-22 13:25:15 +03:00
stuart.armstrong 08596cf178 Add multi-project support. 2023-12-22 12:56:58 +03:00
stuart.armstrong a955139aa0 Remove double entry and gradle. 2023-12-22 11:52:02 +03:00
stuart.armstrong 15175b5bb3 Actions add node tempate 2023-12-22 11:48:11 +03:00
stanislav.melnichuk 7c51032221 Revert "Change ubuntu-latest to fix runner selection."
This reverts commit 0af153083c.
2023-12-21 15:30:27 +03:00
13 changed files with 883 additions and 20 deletions
@@ -0,0 +1,65 @@
name: build
description: Build plugin via yarn & make
inputs:
go_version:
required: false
description: 'GO version'
go_cache:
required: false
description: 'For direct disable go-cache if needed'
node_version:
required: false
description: 'Node.js version'
runs:
using: composite
steps:
- name: ci/setup-go
uses: actions/setup-go@v4
if: ${{ inputs.go_version && inputs.go_cache != 'false' }}
with:
go-version: "${{ inputs.go_version }}"
cache-dependency-path: |
go.sum
server/go.sum
- name: ci/setup-go-wo-cache
uses: actions/setup-go@v4
if: ${{ inputs.go_version && inputs.go_cache == 'false' }}
with:
go-version: "${{ inputs.go_version }}"
cache: false
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 10.6.3
- name: ci/setup-node
uses: actions/setup-node@v4
if: ${{ inputs.node_version }}
with:
node-version: "${{ inputs.node_version }}"
# TODO cache yarn
# cache: "yarn"
# cache-dependency-path: yarn.lock
# TODO tests
# - name: ci/plugin-test
- name: ci/install-deps
if: ${{ inputs.node_version }}
shell: bash
run: |
echo "::group::yarn"
cd webapp
yarn install
echo "::endgroup::"
- name: ci/plugin-build
shell: bash
run: |
echo "::group::dist"
make dist
echo "::endgroup::"
@@ -0,0 +1,45 @@
name: build-channel-export
description: Build plugin via make
inputs:
go_version:
required: false
description: 'GO version'
go_cache:
required: false
description: 'For direct disable go-cache if needed'
node_version:
required: false
description: 'Node.js version'
runs:
using: composite
steps:
- name: ci/setup-go
uses: actions/setup-go@v4
if: ${{ inputs.go_version && inputs.go_cache != 'false' }}
with:
go-version: "${{ inputs.go_version }}"
cache-dependency-path: |
go.sum
server/go.sum
- name: ci/setup-go-wo-cache
uses: actions/setup-go@v4
if: ${{ inputs.go_version && inputs.go_cache == 'false' }}
with:
go-version: "${{ inputs.go_version }}"
cache: false
- name: ci/setup-node
uses: actions/setup-node@v4
if: ${{ inputs.node_version }}
with:
node-version: "${{ inputs.node_version }}"
- name: ci/plugin-build
shell: bash
run: |
echo "::group::dist"
make dist
echo "::endgroup::"
+6
View File
@@ -31,6 +31,11 @@ runs:
go-version: "${{ inputs.go_version }}" go-version: "${{ inputs.go_version }}"
cache: false cache: false
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 10.6.3
- name: ci/setup-node - name: ci/setup-node
uses: actions/setup-node@v4 uses: actions/setup-node@v4
if: ${{ inputs.node_version }} if: ${{ inputs.node_version }}
@@ -48,6 +53,7 @@ runs:
shell: bash shell: bash
run: | run: |
echo "::group::yarn" echo "::group::yarn"
corepack enable
cd webapp cd webapp
yarn install yarn install
echo "::endgroup::" echo "::endgroup::"
@@ -42,12 +42,12 @@ env:
jobs: jobs:
check: check:
name: check and test name: check and test
runs-on: ubuntu-22.04 runs-on: ubuntu-latest
steps: steps:
- uses: https://github.com/actions/checkout@v3 - uses: https://github.com/actions/checkout@v3
- uses: https://github.com/actions/setup-java@v3 - uses: https://github.com/actions/setup-java@v3
with: with:
distribution: 'temurin' distribution: 'zulu'
java-version: 21 java-version: 21
check-latest: "false" check-latest: "false"
- uses: https://github.com/gradle/gradle-build-action@v2 - uses: https://github.com/gradle/gradle-build-action@v2
@@ -138,4 +138,4 @@ jobs:
- name: loop fail notification - name: loop fail notification
if: ${{ inputs.notification_enabled && job.status == 'failure' }} if: ${{ inputs.notification_enabled && job.status == 'failure' }}
uses: https://github.com/mattermost/action-mattermost-notify@master uses: https://github.com/mattermost/action-mattermost-notify@1.1.0
@@ -0,0 +1,161 @@
name: Build and sign plugin with marketplace json formation
on:
workflow_call:
inputs:
go_version:
required: false
description: 'GO version'
go_cache:
required: false
description: 'For direct disable go-cache if needed'
node_version:
required: false
description: 'Node.js version'
vault_secrets_base_path:
required: true
description: 'Base vault secret path'
artifacts_url:
required: true
description: 'Artifacts URL'
artifacts_repository:
required: true
description: 'Artifacts repository'
secrets:
VAULT_ROLE_ID:
required: true
VAULT_SECRET_ID:
required: true
jobs:
release:
name: release
runs-on: ubuntu-22.04-slim
steps:
- name: ci/checkout-repo
uses: actions/checkout@v3
- name: ci/setup-node
uses: actions/setup-node@v4
if: ${{ inputs.node_version }}
with:
node-version: "${{ inputs.node_version }}"
- name: Setup yarn
run: npm install -g yarn
- name: ci/setup-go
uses: actions/setup-go@v4
if: ${{ inputs.go_version && inputs.go_cache != 'false' }}
with:
go-version: "${{ inputs.go_version }}"
cache-dependency-path: |
go.sum
server/go.sum
- name: ci/setup-go-wo-cache
uses: actions/setup-go@v4
if: ${{ inputs.go_version && inputs.go_cache == 'false' }}
with:
go-version: "${{ inputs.go_version }}"
cache: false
- id: publish-secrets
name: ci/publish-secrets
uses: https://github.com/hashicorp/vault-action@v2
with:
url: https://vault.wilix.dev
method: approle
roleId: ${{ secrets.VAULT_ROLE_ID }}
secretId: ${{ secrets.VAULT_SECRET_ID }}
secrets: |
${{ inputs.vault_secrets_base_path }} ARTIFACTS_USERNAME ;
${{ inputs.vault_secrets_base_path }} ARTIFACTS_PASSWORD ;
- id: key
name: ci/key
uses: https://github.com/hashicorp/vault-action@v2
with:
url: https://vault.wilix.dev
method: approle
roleId: ${{ secrets.VAULT_ROLE_ID }}
secretId: ${{ secrets.VAULT_SECRET_ID }}
secrets: |
${{ inputs.vault_secrets_base_path }} SIGN_PRIVATE_KEY_EXPORTED ;
${{ inputs.vault_secrets_base_path }} SIGN_PRIVATE_KEY_ID ;
${{ inputs.vault_secrets_base_path }} SIGN_PRIVATE_KEY_PASSPHRASE ;
- id: plugin-meta
name: ci/plugin-meta
shell: bash
run: |
apt-get update
apt-get install -y jq
echo "PLUGIN=$(jq -r '.id + "-" + .version + ".tar.gz"' plugin.json)" >> "$GITHUB_OUTPUT"
echo "PLUGIN_ID=$(jq -r '.id' plugin.json)" >> "$GITHUB_OUTPUT"
echo "PLUGIN_VERSION=$(jq -r '.version' plugin.json)" >> "$GITHUB_OUTPUT"
echo "ENTERPRISE=$(jq -r '.props.enterprise == true' plugin.json)" >> "$GITHUB_OUTPUT"
echo "BETA=$(jq -r '.version | contains("SNAPSHOT")' plugin.json)" >> "$GITHUB_OUTPUT"
echo "EXPERIMENTAL=$(jq -r '.props.experimental == true' plugin.json)" >> "$GITHUB_OUTPUT"
- name: ci/plugin-build
uses: https://git.wilix.dev/wilix-infra/actions/.gitea/actions/plugin/build-achievements@master
with:
go_version: ${{ inputs.go_version }}
go_cache: ${{ inputs.go_cache }}
node_version: ${{ inputs.node_version }}
ssh_key: ${{ secrets.AI_DEPLOY_KEY }}
- name: ci/plugin-sign
uses: https://git.wilix.dev/wilix-infra/actions/.gitea/actions/file-sign@master
with:
private_key: ${{ steps.key.outputs.SIGN_PRIVATE_KEY_EXPORTED }}
private_key_id: ${{ steps.key.outputs.SIGN_PRIVATE_KEY_ID }}
private_key_passphrase: ${{ steps.key.outputs.SIGN_PRIVATE_KEY_PASSPHRASE }}
filepath: ${{ gitea.workspace }}/dist/${{ steps.plugin-meta.outputs.PLUGIN }}
- name: ci/push-plugin
uses: sonatype-nexus-community/nexus-repo-github-action@master
with:
serverUrl: ${{ inputs.artifacts_url }}
username: ${{ steps.publish-secrets.outputs.ARTIFACTS_USERNAME }}
password: ${{ steps.publish-secrets.outputs.ARTIFACTS_PASSWORD }}
format: raw
repository: ${{ inputs.artifacts_repository }}
coordinates: directory=plugins/${{ steps.plugin-meta.outputs.PLUGIN_ID }}/${{ steps.plugin-meta.outputs.PLUGIN_VERSION }}
assets: filename=${{ steps.plugin-meta.outputs.PLUGIN }}
filename: dist/${{ steps.plugin-meta.outputs.PLUGIN }}
- name: ci/push-plugin-sign
uses: sonatype-nexus-community/nexus-repo-github-action@master
with:
serverUrl: ${{ inputs.artifacts_url }}
username: ${{ steps.publish-secrets.outputs.ARTIFACTS_USERNAME }}
password: ${{ steps.publish-secrets.outputs.ARTIFACTS_PASSWORD }}
format: raw
repository: ${{ inputs.artifacts_repository }}
coordinates: directory=plugins/${{ steps.plugin-meta.outputs.PLUGIN_ID }}/${{ steps.plugin-meta.outputs.PLUGIN_VERSION }}
assets: filename=${{ steps.plugin-meta.outputs.PLUGIN }}.sig
filename: dist/${{ steps.plugin-meta.outputs.PLUGIN }}.sig
- name: ci/plugin-json
uses: https://git.wilix.dev/wilix-infra/actions/.gitea/actions/plugin/json@master
with:
plugin_id: ${{ steps.plugin-meta.outputs.PLUGIN_ID }}
plugin_version: ${{ steps.plugin-meta.outputs.PLUGIN_VERSION }}
enterprise: ${{ steps.plugin-meta.outputs.ENTERPRISE }}
beta: ${{ steps.plugin-meta.outputs.BETA }}
experimental: ${{ steps.plugin-meta.outputs.EXPERIMENTAL }}
artifacts_url: ${{ inputs.artifacts_url }}
artifacts_repository: ${{ inputs.artifacts_repository }}
- name: ci/push-plugin-json
uses: sonatype-nexus-community/nexus-repo-github-action@master
with:
serverUrl: ${{ inputs.artifacts_url }}
username: ${{ steps.publish-secrets.outputs.ARTIFACTS_USERNAME }}
password: ${{ steps.publish-secrets.outputs.ARTIFACTS_PASSWORD }}
format: raw
repository: ${{ inputs.artifacts_repository }}
coordinates: directory=plugins/${{ steps.plugin-meta.outputs.PLUGIN_ID }}/${{ steps.plugin-meta.outputs.PLUGIN_VERSION }}
assets: filename=${{ steps.plugin-meta.outputs.PLUGIN }}.json
filename: dist/${{ steps.plugin-meta.outputs.PLUGIN }}.json
@@ -0,0 +1,136 @@
name: Build and sign plugin with marketplace json formation
on:
workflow_call:
inputs:
go_version:
required: false
description: 'GO version'
go_cache:
required: false
description: 'For direct disable go-cache if needed'
node_version:
required: false
description: 'Node.js version'
vault_secrets_base_path:
required: true
description: 'Base vault secret path'
artifacts_url:
required: true
description: 'Artifacts URL'
artifacts_repository:
required: true
description: 'Artifacts repository'
secrets:
VAULT_ROLE_ID:
required: true
VAULT_SECRET_ID:
required: true
jobs:
release:
name: release
runs-on: ubuntu-22.04
steps:
- name: ci/checkout-repo
uses: actions/checkout@v3
- id: publish-secrets
name: ci/publish-secrets
uses: https://github.com/hashicorp/vault-action@v2
with:
url: https://vault.wilix.dev
method: approle
roleId: ${{ secrets.VAULT_ROLE_ID }}
secretId: ${{ secrets.VAULT_SECRET_ID }}
secrets: |
${{ inputs.vault_secrets_base_path }} ARTIFACTS_USERNAME ;
${{ inputs.vault_secrets_base_path }} ARTIFACTS_PASSWORD ;
- id: key
name: ci/key
uses: https://github.com/hashicorp/vault-action@v2
with:
url: https://vault.wilix.dev
method: approle
roleId: ${{ secrets.VAULT_ROLE_ID }}
secretId: ${{ secrets.VAULT_SECRET_ID }}
secrets: |
${{ inputs.vault_secrets_base_path }} SIGN_PRIVATE_KEY_EXPORTED ;
${{ inputs.vault_secrets_base_path }} SIGN_PRIVATE_KEY_ID ;
${{ inputs.vault_secrets_base_path }} SIGN_PRIVATE_KEY_PASSPHRASE ;
- id: plugin-meta
name: ci/plugin-meta
shell: bash
run: |
apt-get update
apt-get install -y jq
echo "PLUGIN=$(jq -r '.id + "-" + .version + ".tar.gz"' plugin.json)" >> "$GITHUB_OUTPUT"
echo "PLUGIN_ID=$(jq -r '.id' plugin.json)" >> "$GITHUB_OUTPUT"
echo "PLUGIN_VERSION=$(jq -r '.version' plugin.json)" >> "$GITHUB_OUTPUT"
echo "ENTERPRISE=$(jq -r '.props.enterprise == true' plugin.json)" >> "$GITHUB_OUTPUT"
echo "BETA=$(jq -r '.version | contains("SNAPSHOT")' plugin.json)" >> "$GITHUB_OUTPUT"
echo "EXPERIMENTAL=$(jq -r '.props.experimental == true' plugin.json)" >> "$GITHUB_OUTPUT"
- name: ci/plugin-build
uses: https://git.wilix.dev/wilix-infra/actions/.gitea/actions/plugin/build-channel-export@master
with:
go_version: ${{ inputs.go_version }}
go_cache: ${{ inputs.go_cache }}
node_version: ${{ inputs.node_version }}
ssh_key: ${{ secrets.AI_DEPLOY_KEY }}
- name: ci/plugin-sign
uses: https://git.wilix.dev/wilix-infra/actions/.gitea/actions/file-sign@master
with:
private_key: ${{ steps.key.outputs.SIGN_PRIVATE_KEY_EXPORTED }}
private_key_id: ${{ steps.key.outputs.SIGN_PRIVATE_KEY_ID }}
private_key_passphrase: ${{ steps.key.outputs.SIGN_PRIVATE_KEY_PASSPHRASE }}
filepath: ${{ gitea.workspace }}/dist/${{ steps.plugin-meta.outputs.PLUGIN }}
- name: ci/push-plugin
uses: sonatype-nexus-community/nexus-repo-github-action@master
with:
serverUrl: ${{ inputs.artifacts_url }}
username: ${{ steps.publish-secrets.outputs.ARTIFACTS_USERNAME }}
password: ${{ steps.publish-secrets.outputs.ARTIFACTS_PASSWORD }}
format: raw
repository: ${{ inputs.artifacts_repository }}
coordinates: directory=plugins/${{ steps.plugin-meta.outputs.PLUGIN_ID }}/${{ steps.plugin-meta.outputs.PLUGIN_VERSION }}
assets: filename=${{ steps.plugin-meta.outputs.PLUGIN }}
filename: dist/${{ steps.plugin-meta.outputs.PLUGIN }}
- name: ci/push-plugin-sign
uses: sonatype-nexus-community/nexus-repo-github-action@master
with:
serverUrl: ${{ inputs.artifacts_url }}
username: ${{ steps.publish-secrets.outputs.ARTIFACTS_USERNAME }}
password: ${{ steps.publish-secrets.outputs.ARTIFACTS_PASSWORD }}
format: raw
repository: ${{ inputs.artifacts_repository }}
coordinates: directory=plugins/${{ steps.plugin-meta.outputs.PLUGIN_ID }}/${{ steps.plugin-meta.outputs.PLUGIN_VERSION }}
assets: filename=${{ steps.plugin-meta.outputs.PLUGIN }}.sig
filename: dist/${{ steps.plugin-meta.outputs.PLUGIN }}.sig
- name: ci/plugin-json
uses: https://git.wilix.dev/wilix-infra/actions/.gitea/actions/plugin/json@master
with:
plugin_id: ${{ steps.plugin-meta.outputs.PLUGIN_ID }}
plugin_version: ${{ steps.plugin-meta.outputs.PLUGIN_VERSION }}
enterprise: ${{ steps.plugin-meta.outputs.ENTERPRISE }}
beta: ${{ steps.plugin-meta.outputs.BETA }}
experimental: ${{ steps.plugin-meta.outputs.EXPERIMENTAL }}
artifacts_url: ${{ inputs.artifacts_url }}
artifacts_repository: ${{ inputs.artifacts_repository }}
- name: ci/push-plugin-json
uses: sonatype-nexus-community/nexus-repo-github-action@master
with:
serverUrl: ${{ inputs.artifacts_url }}
username: ${{ steps.publish-secrets.outputs.ARTIFACTS_USERNAME }}
password: ${{ steps.publish-secrets.outputs.ARTIFACTS_PASSWORD }}
format: raw
repository: ${{ inputs.artifacts_repository }}
coordinates: directory=plugins/${{ steps.plugin-meta.outputs.PLUGIN_ID }}/${{ steps.plugin-meta.outputs.PLUGIN_VERSION }}
assets: filename=${{ steps.plugin-meta.outputs.PLUGIN }}.json
filename: dist/${{ steps.plugin-meta.outputs.PLUGIN }}.json
@@ -29,7 +29,7 @@ on:
jobs: jobs:
release: release:
name: release name: release
runs-on: ubuntu-22.04 runs-on: node-22
steps: steps:
- name: ci/checkout-repo - name: ci/checkout-repo
uses: actions/checkout@v3 uses: actions/checkout@v3
@@ -57,7 +57,8 @@ jobs:
secrets: | secrets: |
${{ inputs.vault_secrets_base_path }} SIGN_PRIVATE_KEY_EXPORTED ; ${{ inputs.vault_secrets_base_path }} SIGN_PRIVATE_KEY_EXPORTED ;
${{ inputs.vault_secrets_base_path }} SIGN_PRIVATE_KEY_ID ; ${{ inputs.vault_secrets_base_path }} SIGN_PRIVATE_KEY_ID ;
${{ inputs.vault_secrets_base_path }} SIGN_PRIVATE_KEY_PASSPHRASE ; ${{ inputs.vault_secrets_base_path }} SIGN_PRIVATE_KEY_PASSPHRASE ;
${{ inputs.vault_secrets_base_path }} AI_DEPLOY_KEY ;
- id: plugin-meta - id: plugin-meta
name: ci/plugin-meta name: ci/plugin-meta
@@ -65,13 +66,18 @@ jobs:
run: | run: |
apt-get update apt-get update
apt-get install -y jq apt-get install -y jq
echo "PLUGIN=$(jq -r '.id + "-" + .version + ".tar.gz"' plugin.json)" >> "$GITHUB_OUTPUT" echo "PLUGIN=$(jq -r '.id + "-" + .version + ".tar.gz"' plugin.json)" >> "$GITHUB_OUTPUT"
echo "PLUGIN_ID=$(jq -r '.id' plugin.json)" >> "$GITHUB_OUTPUT" echo "PLUGIN_ID=$(jq -r '.id' plugin.json)" >> "$GITHUB_OUTPUT"
echo "PLUGIN_VERSION=$(jq -r '.version' plugin.json)" >> "$GITHUB_OUTPUT" echo "PLUGIN_VERSION=$(jq -r '.version' plugin.json)" >> "$GITHUB_OUTPUT"
echo "ENTERPRISE=$(jq -r '.props.enterprise == true' plugin.json)" >> "$GITHUB_OUTPUT" echo "ENTERPRISE=$(jq -r '.props.enterprise == true' plugin.json)" >> "$GITHUB_OUTPUT"
echo "BETA=$(jq -r '.version | contains("SNAPSHOT")' plugin.json)" >> "$GITHUB_OUTPUT" echo "BETA=$(jq -r '.version | contains("SNAPSHOT")' plugin.json)" >> "$GITHUB_OUTPUT"
echo "EXPERIMENTAL=$(jq -r '.props.experimental == true' plugin.json)" >> "$GITHUB_OUTPUT" echo "EXPERIMENTAL=$(jq -r '.props.experimental == true' plugin.json)" >> "$GITHUB_OUTPUT"
- name: Decode Base64 secret
run: |
echo "${{ steps.key.outputs.AI_DEPLOY_KEY }}" | base64 --decode > /tmp/ssh_key
chmod 400 /tmp/ssh_key
- name: ci/plugin-build - name: ci/plugin-build
uses: https://git.wilix.dev/wilix-infra/actions/.gitea/actions/plugin/build@master uses: https://git.wilix.dev/wilix-infra/actions/.gitea/actions/plugin/build@master
with: with:
@@ -87,17 +93,25 @@ jobs:
private_key_passphrase: ${{ steps.key.outputs.SIGN_PRIVATE_KEY_PASSPHRASE }} private_key_passphrase: ${{ steps.key.outputs.SIGN_PRIVATE_KEY_PASSPHRASE }}
filepath: ${{ gitea.workspace }}/dist/${{ steps.plugin-meta.outputs.PLUGIN }} filepath: ${{ gitea.workspace }}/dist/${{ steps.plugin-meta.outputs.PLUGIN }}
#- name: ci/push-plugin
# uses: sonatype-nexus-community/nexus-repo-github-action@master
# with:
# serverUrl: ${{ inputs.artifacts_url }}
# username: ${{ steps.publish-secrets.outputs.ARTIFACTS_USERNAME }}
# password: ${{ steps.publish-secrets.outputs.ARTIFACTS_PASSWORD }}
# format: raw
# repository: ${{ inputs.artifacts_repository }}
# coordinates: directory=plugins/${{ steps.plugin-meta.outputs.PLUGIN_ID }}/${{ steps.plugin-meta.outputs.PLUGIN_VERSION }}
# assets: filename=${{ steps.plugin-meta.outputs.PLUGIN }}
# filename: dist/${{ steps.plugin-meta.outputs.PLUGIN }}
- name: ci/push-plugin - name: ci/push-plugin
uses: sonatype-nexus-community/nexus-repo-github-action@master run: |
with: curl -u "${{ steps.publish-secrets.outputs.ARTIFACTS_USERNAME }}:${{ steps.publish-secrets.outputs.ARTIFACTS_PASSWORD }}" \
serverUrl: ${{ inputs.artifacts_url }} -X POST "${{ inputs.artifacts_url }}/service/rest/v1/components?repository=${{ inputs.artifacts_repository }}" \
username: ${{ steps.publish-secrets.outputs.ARTIFACTS_USERNAME }} -F "raw.directory=/plugins/${{ steps.plugin-meta.outputs.PLUGIN_ID }}/${{ steps.plugin-meta.outputs.PLUGIN_VERSION }}" \
password: ${{ steps.publish-secrets.outputs.ARTIFACTS_PASSWORD }} -F "raw.asset1=@dist/${{ steps.plugin-meta.outputs.PLUGIN }}" \
format: raw -F "raw.asset1.filename=${{ steps.plugin-meta.outputs.PLUGIN }}"
repository: ${{ inputs.artifacts_repository }}
coordinates: directory=plugins/${{ steps.plugin-meta.outputs.PLUGIN_ID }}/${{ steps.plugin-meta.outputs.PLUGIN_VERSION }}
assets: filename=${{ steps.plugin-meta.outputs.PLUGIN }}
filename: dist/${{ steps.plugin-meta.outputs.PLUGIN }}
- name: ci/push-plugin-sign - name: ci/push-plugin-sign
uses: sonatype-nexus-community/nexus-repo-github-action@master uses: sonatype-nexus-community/nexus-repo-github-action@master
@@ -0,0 +1,115 @@
name: Mobile pull request check
on:
workflow_call:
inputs:
node-version:
description: "Set node version"
default: 20
type: string
notification_enabled:
description: "Включение оповещений о разворачивании, требуется иметь url для оповещений в vault"
default: false
required: false
type: boolean
custom_notification_hook_enabled:
description: "Использовать ли кастомный url хук для оповещений (должен лежать в vault секрете проекта)"
default: false
required: false
type: boolean
notification_channel:
description: "Канал для оповещений о результатах деплоя"
default: internal_projects_notifications
required: false
type: string
vault_secrets_base_path:
description: 'Базовый путь для секретов проекта в vault'
required: false
type: string
secrets:
VAULT_ROLE_ID:
required: true
VAULT_SECRET_ID:
required: true
env:
vault_main_base_path: dev/wilix/main/data/ci
jobs:
check:
name: mobile check and test
runs-on: ubuntu-latest
steps:
- name: ci/checkout-repo
uses: actions/checkout@v3
- name: Use Node.js ${{ inputs.node-version }}
uses: https://github.com/actions/setup-node@v3
with:
node-version: ${{ inputs.node-version }}
- name: ci/prepare-node-deps
uses: ./.gitea/actions/prepare-node-deps
- name: ci/check-styles
shell: bash
run: |
echo "::group::check-styles"
npm run check
echo "::endgroup::"
- name: ci/run-tests
shell: bash
run: |
echo "::group::run-tests"
npm run test:ci
echo "::endgroup::"
- name: Get general notification url
if: ${{ inputs.notification_enabled && ! inputs.custom_notification_hook_enabled && (job.status == 'success' || job.status == 'failure') }}
uses: https://github.com/hashicorp/vault-action@v2
with:
url: https://vault.wilix.dev
method: approle
roleId: ${{ secrets.VAULT_ROLE_ID }}
secretId: ${{ secrets.VAULT_SECRET_ID }}
secrets: |
${{ env.vault_main_base_path }} notification_url | MATTERMOST_WEBHOOK_URL ;
- name: Get custom notification url
if: ${{ inputs.notification_enabled && inputs.custom_notification_hook_enabled && (job.status == 'success' || job.status == 'failure') }}
uses: https://github.com/hashicorp/vault-action@v2
with:
url: https://vault.wilix.dev
method: approle
roleId: ${{ secrets.VAULT_ROLE_ID }}
secretId: ${{ secrets.VAULT_SECRET_ID }}
secrets: |
${{ inputs.vault_secrets_base_path }} notification_url | MATTERMOST_WEBHOOK_URL ;
- name: prepare failed notification body
if: ${{ inputs.notification_enabled && job.status == 'failure' }}
uses: https://github.com/finnp/create-file-action@master
env:
FILE_NAME: "mattermost.json"
FILE_DATA: |
{
"channel": "${{ inputs.notification_channel }}",
"attachments": [
{
"fallback": "Проверка упала ${{ gitea.repository }}",
"text": "@${{ gitea.actor }} упала тестовая сборка",
"color": "#FF0000",
"fields": [
{
"short": true,
"title": "Сборка",
"value": "https://git.wilix.dev/${{ gitea.repository }}/actions/runs/${{ gitea.run_id }}"
}
]
}
]
}
- name: loop fail notification
if: ${{ inputs.notification_enabled && job.status == 'failure' }}
uses: https://github.com/mattermost/action-mattermost-notify@1.1.0
@@ -0,0 +1,112 @@
name: Pull request check
on:
workflow_call:
inputs:
node-version:
description: "Set node version"
default: 20
type: string
yarn-commands:
description: "yarn-commands"
default: |-
yarn install
yarn test
type: string
notification_enabled:
description: "Включение оповещений о разворачивании, требуется иметь url для оповещений в vault"
default: false
required: false
type: boolean
custom_notification_hook_enabled:
description: "Использовать ли кастомный url хук для оповещений (должен лежать в vault секрете проекта)"
default: false
required: false
type: boolean
notification_channel:
description: "Канал для оповещений о результатах деплоя"
default: internal_projects_notifications
required: false
type: string
vault_secrets_base_path:
description: 'Базовый путь для секретов проекта в vault'
required: false
type: string
sonar_enabled:
default: false
required: false
type: boolean
secrets:
VAULT_ROLE_ID:
required: true
VAULT_SECRET_ID:
required: true
env:
vault_main_base_path: dev/wilix/main/data/ci
jobs:
check:
name: check and test
runs-on: ubuntu-latest
steps:
- uses: https://github.com/actions/checkout@v3
- name: Use Node.js ${{ inputs.node-version }}
uses: https://github.com/actions/setup-node@v3
with:
node-version: ${{ inputs.node-version }}
- run: ${{ inputs.yarn-commands }}
- name: dockerfile lint check
uses: https://github.com/hadolint/hadolint-action@v3.1.0
with:
dockerfile: Dockerfile
- name: Get general notification url
if: ${{ inputs.notification_enabled && ! inputs.custom_notification_hook_enabled && (job.status == 'success' || job.status == 'failure') }}
uses: https://github.com/hashicorp/vault-action@v2
with:
url: https://vault.wilix.dev
method: approle
roleId: ${{ secrets.VAULT_ROLE_ID }}
secretId: ${{ secrets.VAULT_SECRET_ID }}
secrets: |
${{ env.vault_main_base_path }} notification_url | MATTERMOST_WEBHOOK_URL ;
- name: Get custom notification url
if: ${{ inputs.notification_enabled && inputs.custom_notification_hook_enabled && (job.status == 'success' || job.status == 'failure') }}
uses: https://github.com/hashicorp/vault-action@v2
with:
url: https://vault.wilix.dev
method: approle
roleId: ${{ secrets.VAULT_ROLE_ID }}
secretId: ${{ secrets.VAULT_SECRET_ID }}
secrets: |
${{ inputs.vault_secrets_base_path }} notification_url | MATTERMOST_WEBHOOK_URL ;
- name: prepare failed notification body
if: ${{ inputs.notification_enabled && job.status == 'failure' }}
uses: https://github.com/finnp/create-file-action@master
env:
FILE_NAME: "mattermost.json"
FILE_DATA: |
{
"channel": "${{ inputs.notification_channel }}",
"attachments": [
{
"fallback": "Проверка упала ${{ gitea.repository }}",
"text": "@${{ gitea.actor }} упала тестовая сборка",
"color": "#FF0000",
"fields": [
{
"short": true,
"title": "Сборка",
"value": "https://git.wilix.dev/${{ gitea.repository }}/actions/runs/${{ gitea.run_id }}"
}
]
}
]
}
- name: loop fail notification
if: ${{ inputs.notification_enabled && job.status == 'failure' }}
uses: https://github.com/mattermost/action-mattermost-notify@1.1.0
+1 -1
View File
@@ -26,7 +26,7 @@ env:
jobs: jobs:
cleanup: cleanup:
name: Cleanup name: Cleanup
runs-on: ubuntu-22.04 runs-on: ubuntu-latest
steps: steps:
- uses: https://github.com/actions/checkout@v3 - uses: https://github.com/actions/checkout@v3
- name: Fetch all history for all tags and branches - name: Fetch all history for all tags and branches
+36 -2
View File
@@ -55,6 +55,10 @@ on:
required: true required: true
VAULT_SECRET_ID: VAULT_SECRET_ID:
required: true required: true
# Optional: Docker/npm private registry token (passed as WERF_BUILD_ARG_NPM_TOKEN).
# Callers that build images needing @scope packages from Nexus should pass this.
NPM_TOKEN:
required: false
env: env:
vault_main_base_path: dev/wilix/main/data/ci vault_main_base_path: dev/wilix/main/data/ci
@@ -62,7 +66,7 @@ env:
jobs: jobs:
converge: converge:
name: Deploy stand name: Deploy stand
runs-on: ubuntu-22.04 runs-on: ubuntu-latest
steps: steps:
- name: Checkout code - name: Checkout code
@@ -117,6 +121,36 @@ jobs:
if: ${{ inputs.werf_debug }} if: ${{ inputs.werf_debug }}
run: echo "WERF_LOG_DEBUG=true" >> "$GITHUB_ENV" run: echo "WERF_LOG_DEBUG=true" >> "$GITHUB_ENV"
# Prefer Gitea secret; fall back to Vault project CI secret (same base path as werf key).
- id: import-npm-token
name: Get NPM_TOKEN from vault (fallback)
continue-on-error: true
uses: https://github.com/hashicorp/vault-action@v2
with:
url: https://vault.wilix.dev
method: approle
roleId: ${{ secrets.VAULT_ROLE_ID }}
secretId: ${{ secrets.VAULT_SECRET_ID }}
secrets: |
${{ inputs.vault_secrets_base_path }} NPM_TOKEN | VAULT_NPM_TOKEN ;
- name: Resolve NPM_TOKEN for Docker build-args
id: resolve-npm-token
run: |
TOKEN="${{ secrets.NPM_TOKEN }}"
if [ -z "$TOKEN" ]; then
TOKEN="${{ steps.import-npm-token.outputs.VAULT_NPM_TOKEN }}"
fi
if [ -z "$TOKEN" ]; then
echo "NPM_TOKEN is empty. Set Gitea Actions secret NPM_TOKEN or Vault key" >&2
echo " ${{ inputs.vault_secrets_base_path }} → NPM_TOKEN" >&2
exit 1
fi
# Mask + export for werf (WERF_BUILD_ARG_* → docker --build-arg)
echo "::add-mask::$TOKEN"
echo "NPM_TOKEN=$TOKEN" >> "$GITHUB_ENV"
echo "WERF_BUILD_ARG_NPM_TOKEN=$TOKEN" >> "$GITHUB_ENV"
- name: Deploy - name: Deploy
run: werf converge run: werf converge
env: env:
@@ -197,5 +231,5 @@ jobs:
} }
- name: loop fail notification - name: loop fail notification
uses: https://github.com/mattermost/action-mattermost-notify@master uses: https://github.com/mattermost/action-mattermost-notify@1.1.0
if: ${{ inputs.notification_enabled && (job.status == 'success' || job.status == 'failure') }} if: ${{ inputs.notification_enabled && (job.status == 'success' || job.status == 'failure') }}
@@ -0,0 +1,68 @@
name: Cleanup Yonote Docker registry
on:
workflow_call:
inputs:
docker_repo_path:
default: private.docker.wilix.dev
required: false
type: string
docker_images_path:
description: 'Относительный путь для образов проекта'
required: true
type: string
werf_debug:
default: false
required: false
type: boolean
secrets:
VAULT_ROLE_ID:
required: true
VAULT_SECRET_ID:
required: true
env:
vault_main_base_path: dev/wilix/main/data/ci
jobs:
cleanup:
name: Cleanup
runs-on: ubuntu-latest
steps:
- uses: https://github.com/actions/checkout@v3
- name: Fetch all history for all tags and branches
run: git fetch --prune --unshallow
# FIXME Эти секреты нужно будет сделать полностью различными для проектов, идеально - краткосрочные генерируемые vault
- id: import-secrets
uses: https://github.com/hashicorp/vault-action@v2
with:
url: https://vault.wilix.dev
method: approle
roleId: ${{ secrets.VAULT_ROLE_ID }}
secretId: ${{ secrets.VAULT_SECRET_ID }}
secrets: |
${{ env.vault_main_base_path }} local_cluster_kube_config_base64 ;
${{ env.vault_main_base_path }} docker_registry_username ;
${{ env.vault_main_base_path }} docker_registry_password ;
dev/wilix/yonote/data/ci/yonote NPM_AUTH_TOKEN ;
- name: Login to wilix nexus Container Registry
uses: https://github.com/docker/login-action@v2
with:
registry: ${{ inputs.docker_repo_path }}
username: ${{ steps.import-secrets.outputs.docker_registry_username }}
password: ${{ steps.import-secrets.outputs.docker_registry_password }}
- name: Install werf
uses: https://github.com/werf/actions/install@v1.2
- name: Setup debug if need
if: ${{ inputs.werf_debug }}
run: echo "WERF_LOG_DEBUG=true" >> "$GITHUB_ENV"
- name: Cleanup
run: werf cleanup
env:
WERF_REPO: ${{ inputs.docker_repo_path }}/${{ inputs.docker_images_path }}
WERF_KUBECONFIG_BASE64: ${{ steps.import-secrets.outputs.local_cluster_kube_config_base64 }}
NPM_AUTH_TOKEN: ${{ steps.import-secrets.outputs.NPM_AUTH_TOKEN }}
@@ -0,0 +1,107 @@
name: Pull request check
on:
workflow_call:
inputs:
node-version:
description: "Set node version"
default: 20
type: string
yarn-commands:
description: "yarn-commands"
default: |-
yarn install
yarn test
type: string
notification_enabled:
description: "Включение оповещений о разворачивании, требуется иметь url для оповещений в vault"
default: false
required: false
type: boolean
custom_notification_hook_enabled:
description: "Использовать ли кастомный url хук для оповещений (должен лежать в vault секрете проекта)"
default: false
required: false
type: boolean
notification_channel:
description: "Канал для оповещений о результатах деплоя"
default: internal_projects_notifications
required: false
type: string
vault_secrets_base_path:
description: 'Базовый путь для секретов проекта в vault'
required: false
type: string
sonar_enabled:
default: false
required: false
type: boolean
secrets:
VAULT_ROLE_ID:
required: true
VAULT_SECRET_ID:
required: true
env:
vault_main_base_path: dev/wilix/main/data/ci
jobs:
check:
name: check and test
runs-on: ubuntu-latest
steps:
- uses: https://github.com/actions/checkout@v3
- name: Use Node.js ${{ inputs.node-version }}
uses: https://github.com/actions/setup-node@v3
with:
node-version: ${{ inputs.node-version }}
- run: ${{ inputs.yarn-commands }}
- name: Get general notification url
if: ${{ inputs.notification_enabled && ! inputs.custom_notification_hook_enabled && (job.status == 'success' || job.status == 'failure') }}
uses: https://github.com/hashicorp/vault-action@v2
with:
url: https://vault.wilix.dev
method: approle
roleId: ${{ secrets.VAULT_ROLE_ID }}
secretId: ${{ secrets.VAULT_SECRET_ID }}
secrets: |
${{ env.vault_main_base_path }} notification_url | MATTERMOST_WEBHOOK_URL ;
- name: Get custom notification url
if: ${{ inputs.notification_enabled && inputs.custom_notification_hook_enabled && (job.status == 'success' || job.status == 'failure') }}
uses: https://github.com/hashicorp/vault-action@v2
with:
url: https://vault.wilix.dev
method: approle
roleId: ${{ secrets.VAULT_ROLE_ID }}
secretId: ${{ secrets.VAULT_SECRET_ID }}
secrets: |
${{ inputs.vault_secrets_base_path }} notification_url | MATTERMOST_WEBHOOK_URL ;
- name: prepare failed notification body
if: ${{ inputs.notification_enabled && job.status == 'failure' }}
uses: https://github.com/finnp/create-file-action@master
env:
FILE_NAME: "mattermost.json"
FILE_DATA: |
{
"channel": "${{ inputs.notification_channel }}",
"attachments": [
{
"fallback": "Проверка упала ${{ gitea.repository }}",
"text": "@${{ gitea.actor }} упала тестовая сборка",
"color": "#FF0000",
"fields": [
{
"short": true,
"title": "Сборка",
"value": "https://git.wilix.dev/${{ gitea.repository }}/actions/runs/${{ gitea.run_id }}"
}
]
}
]
}
- name: loop fail notification
if: ${{ inputs.notification_enabled && job.status == 'failure' }}
uses: https://github.com/mattermost/action-mattermost-notify@1.1.0