From 84d3b6d3cb19b310bf9a769cb227e96dd8474080 Mon Sep 17 00:00:00 2001 From: Ivan Borshchov Date: Sat, 11 Jan 2025 16:59:13 +0200 Subject: [PATCH] fix: add SLACK_WEBHOOK to woodpecker allowed secrets --- .../index.md | 31 ++++++++++++++++++- live-demo/deploy/.woodpecker.yml | 2 +- 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/adminforth/documentation/blog/2025-01-09-how-adminforth-manages-version/index.md b/adminforth/documentation/blog/2025-01-09-how-adminforth-manages-version/index.md index 1d5cab35..45b6c985 100644 --- a/adminforth/documentation/blog/2025-01-09-how-adminforth-manages-version/index.md +++ b/adminforth/documentation/blog/2025-01-09-how-adminforth-manages-version/index.md @@ -81,7 +81,31 @@ In `package.json` add: //diff-add "release": { //diff-add - "branches": [main", "next"] + "branches": [main", "next"], +//diff-add + "plugins": [ +//diff-add + [ +//diff-add + "@semantic-release/exec", +//diff-add + { +//diff-add + "prepareCmd": "npm run build" +//diff-add + } +//diff-add + ], +//diff-add + "@semantic-release/commit-analyzer", +//diff-add + "@semantic-release/release-notes-generator", +//diff-add + "@semantic-release/npm", +//diff-add + "@semantic-release/github" +//diff-add + ], //diff-add } } @@ -89,10 +113,15 @@ In `package.json` add: Make sure name in package.json has your organisation name like mine `@devforth/` and you have access to publish packages to npmjs.com. + +Also install `semantic-release` and `@semantic-release/exec`: + ``` npm i -D semantic-release @semantic-release/exec ``` +We use `@semantic-release/exec` to run `npm run build` as prepare step for release. Of course you can run build before calling `semantic-release` in CI pipleine, but this approach will allow to nativeley integrate it with `semantic-release` and e.g. show build errors in semantic-release notification plugins. + ## Connecting to CI We will use Woodpecker CI for this example. Woodpecker is a free and open-source CI/CD tool that you can install to your own server / VPS and will not need to pay only for server. No limits on pipelines, users, repositories, etc. If you want to try it, we have [Woodpecker installation guide](https://devforth.io/blog/step-by-step-guide-to-modern-secure-ci-setup/) diff --git a/live-demo/deploy/.woodpecker.yml b/live-demo/deploy/.woodpecker.yml index ab431198..ef6c52a5 100644 --- a/live-demo/deploy/.woodpecker.yml +++ b/live-demo/deploy/.woodpecker.yml @@ -17,12 +17,12 @@ steps: commands: - cd adminforth - npm clean-install - # - npm run build - npm audit signatures - npx semantic-release secrets: - GITHUB_TOKEN - NPM_TOKEN + - SLACK_WEBHOOK build-live-demo: when: