Skip to content

Commit 0e57050

Browse files
use release it
1 parent b1554a8 commit 0e57050

File tree

8 files changed

+57
-86
lines changed

8 files changed

+57
-86
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
const {name, version}=require('../../../../package.json')
2+
console.log (`name: ${name}`)
3+
console.log (`version: ${version}`)
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/sh
2+
node .deploy/pipelines/scripts/ci/name-version.js
Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
1-
#!/bin/sh
2-
3-
echo ${GITHUB_TOKEN} | gh auth login --with-token
4-
export TARGET_BRANCH=$(gh api graphql -f repositoryOwner="${CF_REPO_OWNER}" -f repositoryName="${CF_REPO_NAME}" -f branchName="${CF_BRANCH}" -f query='
5-
query getTargetBranch($repositoryOwner: String!, $repositoryName: String!, $branchName: String!) {
6-
organization(login: $repositoryOwner) {
7-
repository(name: $repositoryName) {
8-
defaultBranchRef {
9-
name
10-
}
11-
pullRequests(first: 1, headRefName: $branchName) {
12-
edges {
13-
node {
14-
baseRefName
15-
}
16-
}
17-
}
18-
}
19-
}
20-
}
21-
' | jq -r '.data.organization.repository | .pullRequests.edges[0].node.baseRefName // .defaultBranchRef.name')
22-
echo "Target Branch: ${TARGET_BRANCH}"
23-
export TARGET_VERSION=$(git show origin/${TARGET_BRANCH}:service.yaml | yq -r ".version" -)
24-
echo "Target Version: ${TARGET_VERSION}"
25-
export PACKAGE_VERSION=$(if [ -f VERSION ]; then cat VERSION; else yq -r ".version" service.yaml; fi;)
26-
echo "Package Version: ${PACKAGE_VERSION}"
27-
semver-cli greater ${PACKAGE_VERSION} ${TARGET_VERSION}
28-
1+
##!/bin/sh
2+
#
3+
#echo ${GITHUB_TOKEN} | gh auth login --with-token
4+
#export TARGET_BRANCH=$(gh api graphql -f repositoryOwner="${CF_REPO_OWNER}" -f repositoryName="${CF_REPO_NAME}" -f branchName="${CF_BRANCH}" -f query='
5+
# query getTargetBranch($repositoryOwner: String!, $repositoryName: String!, $branchName: String!) {
6+
# organization(login: $repositoryOwner) {
7+
# repository(name: $repositoryName) {
8+
# defaultBranchRef {
9+
# name
10+
# }
11+
# pullRequests(first: 1, headRefName: $branchName) {
12+
# edges {
13+
# node {
14+
# baseRefName
15+
# }
16+
# }
17+
# }
18+
# }
19+
# }
20+
# }
21+
#' | jq -r '.data.organization.repository | .pullRequests.edges[0].node.baseRefName // .defaultBranchRef.name')
22+
#echo "Target Branch: ${TARGET_BRANCH}"
23+
#export TARGET_VERSION=$(git show origin/${TARGET_BRANCH}:service.yaml | yq -r ".version" -)
24+
#echo "Target Version: ${TARGET_VERSION}"
25+
#export PACKAGE_VERSION=$(if [ -f VERSION ]; then cat VERSION; else yq -r ".version" service.yaml; fi;)
26+
#echo "Package Version: ${PACKAGE_VERSION}"
27+
#semver-cli greater ${PACKAGE_VERSION} ${TARGET_VERSION}
28+
#
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/sh
2+
release-it --patch --ci

.github/workflows/latest.yml

Lines changed: 0 additions & 27 deletions
This file was deleted.

.github/workflows/merged.yml

Lines changed: 0 additions & 29 deletions
This file was deleted.

.release-it.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
2+
{
3+
"use" : "release-it --patch --ci",
4+
"npm": {
5+
"publish": false
6+
},
7+
"git": {
8+
"commitMessage": "chore: release v${version}"
9+
},
10+
"github": {
11+
"release": true
12+
},
13+
"hooks": {
14+
"before:init": ["echo init"],
15+
"after:bump": "echo 'afterbump';.deploy/pipelines/scripts/ci/name-version.sh > ./service.yaml",
16+
"after:git:release": "echo After git push, before github release; echo 'after:git';git tag -f latest; git tag latest --force;git push --tags --force",
17+
"after:release": "echo Successfully released ${name} v${version} to ${repo.repository}."
18+
}
19+
}

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "csdp-report-image",
3-
"version": "0.0.1",
3+
"version": "0.0.84",
44
"description": "CI tools client reporting a buit image by calling image-report and receiving progress events",
55
"main": "index.js",
66
"repository": "git@github.com:codefresh-io/csdp-report-image.git",
@@ -18,7 +18,8 @@
1818
"test": "jest --passWithNoTests",
1919
"test:watch": "jest --watch",
2020
"test:cov": "jest --coverage",
21-
"ci-test": "yarn install && yarn test && yarn prebuild"
21+
"ci-test": "yarn install && yarn test && yarn prebuild",
22+
"release": "yarn run release-it --patch --ci"
2223
},
2324
"engines": {
2425
"node": "16.14.2"

0 commit comments

Comments
 (0)