Skip to content

Commit be49c95

Browse files
Itai GendlerItai Gendler
authored andcommitted
update build flow to trigger release flow in case version was changed
1 parent 9bcece0 commit be49c95

File tree

2 files changed

+20
-12
lines changed

2 files changed

+20
-12
lines changed

codefresh-release.yml

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,6 @@ version: '1.0'
33

44
steps:
55

6-
update_documentation:
7-
title: "Update documentation http://cli.codefresh.io"
8-
image: codefresh/cli-build
9-
commands:
10-
- "yarn install"
11-
- "echo Building public docs"
12-
- "yarn build-public-docs"
13-
- "echo Push new docs to gh-pages detached branch"
14-
- 'cd public && git add --all && git commit -m "Publish new documentation for version ${{PACKAGE_VERSION}}"'
15-
environment:
16-
- HUGO_VERSION=0.32.0
17-
186
fail_if_not_master:
197
title: "Validate running on master branch"
208
image: codefresh/cli-build
@@ -101,3 +89,16 @@ steps:
10189
- "mv ./dist/codefresh-win.exe ./dist/codefresh.exe"
10290
- "zip codefresh-v${{PACKAGE_VERSION}}-win-x64.zip README.md LICENSE -j ./dist/codefresh.exe "
10391
- 'curl --fail -X POST -H "Content-Type:application/octet-stream" -H "Authorization: token ${{GITHUB_TOKEN}}" --data-binary @codefresh-v${{PACKAGE_VERSION}}-win-x64.zip https://uploads.github.com/repos/codefresh-io/cli/releases/${{GITHUB_RELEASE_ID}}/assets?name=codefresh-v${{PACKAGE_VERSION}}-win-x64.zip'
92+
93+
94+
update_documentation:
95+
title: "Update documentation http://cli.codefresh.io"
96+
image: codefresh/cli-build
97+
commands:
98+
- "yarn install"
99+
- "echo Building public docs"
100+
- "yarn build-public-docs"
101+
- "echo Push new docs to gh-pages detached branch"
102+
- 'cd public && git add --all && git commit -m "Publish new documentation for version ${{PACKAGE_VERSION}}"'
103+
environment:
104+
- HUGO_VERSION=0.32.0

codefresh.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,10 @@ steps:
3434
tag: ${{CF_SHORT_REVISION}}
3535
registry: "CFCR"
3636

37+
execute_release_pipeline:
38+
title: "Execute release pipeline in case version was changed"
39+
image: codefresh/cli
40+
commands:
41+
- 'export PACKAGE_VERSION=$(jq -r ".version" package.json)'
42+
- "echo Current version: $PACKAGE_VERSION"
43+
- "git tag | grep $PACKAGE_VERSION; if [ $? -eq 0 ]; codefresh run 5a4c94d282ed4d00012b54e8 -b=master; else echo Not running release flow because version has not changed; fi"

0 commit comments

Comments
 (0)