Skip to content

Commit

Permalink
Merge branch 'fix/ci' into 'main'
Browse files Browse the repository at this point in the history
💚 (i18n,decidim-client) Handle crowdin and decidim-client publishing in gitlab

See merge request decidim/decidim-chatbot/decidim-module-rest_full!4
  • Loading branch information
Hadrien Froger committed Nov 22, 2024
2 parents 4b452bc + 81b29e0 commit 1d08660
Show file tree
Hide file tree
Showing 5 changed files with 2,292 additions and 3,964 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,5 @@ development_app
node_modules
.yarn
.local
.npm
.npm
.cache
20 changes: 10 additions & 10 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,17 +76,17 @@ crowdin::upload:
- crowdin upload -T $CROWDIN_PERSONAL_TOKEN -i $CROWDIN_PROJECT_ID --no-progress
- crowdin status -T $CROWDIN_PERSONAL_TOKEN -i $CROWDIN_PROJECT_ID --no-progress
rules:
- if: '$CI_COMMIT_BRANCH == "main" && $GITLAB_USER_ID == $TRANSLATIONBOT_ID'
when: always
- if: '$CI_COMMIT_BRANCH == "main"'
when: manual
##
# Create a Merge request in the project with updated
# crowndin translations.
crowdin::merge_request:
stage: translate
image: node:18.20
rules:
- if: '$CI_COMMIT_BRANCH == "main" && $GITLAB_USER_ID != $TRANSLATIONBOT_ID'
when: always
- if: '$CI_COMMIT_BRANCH == "main"'
when: manual
before_script:
- apt-get update && apt-get install -y git
script:
Expand Down Expand Up @@ -132,20 +132,20 @@ ruby::rspec:
# Publish decidim rest full api package
decidim-client::publish:
image: node:18.20
variables:
CI: 1
before_script:
- cd contrib/decidim-node-client
- corepack enable
- yarn
- |
{
echo "@${CI_PROJECT_ROOT_NAMESPACE}:registry=${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/npm/"
echo "${CI_API_V4_URL#https?}/projects/${CI_PROJECT_ID}/packages/npm/:_authToken=\${CI_JOB_TOKEN}"
} | tee -a .npmrc
cache:
key: ${CI_COMMIT_REF_SLUG}
paths:
- .yarn/
script:
- yarn build
- yarn publish --non-interactive
- touch .npmrc
- echo "@${CI_PROJECT_ROOT_NAMESPACE}:registry=${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/npm/" >> .npmrc
- echo "${CI_API_V4_URL#http*:}/projects/${CI_PROJECT_ID}/packages/npm/:_authToken=\${CI_JOB_TOKEN}" >> .npmrc
- npm publish --non-interactive --registry=${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/npm/
extends: .publication_rules
4 changes: 4 additions & 0 deletions contrib/decidim-node-client/.yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
nodeLinker: node-modules
npmScopes:
octree:
npmRegistryServer: "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/npm/"
npmAuthToken: "${NODE_AUTH_TOKEN}"
6 changes: 6 additions & 0 deletions contrib/decidim-node-client/packup.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { defineConfig } from '@strapi/pack-up';

export default defineConfig({
runtime: 'node',
preserveModules: true,
});
Loading

0 comments on commit 1d08660

Please sign in to comment.