Skip to content

Commit

Permalink
ci: set dev version
Browse files Browse the repository at this point in the history
  • Loading branch information
sandipndev committed May 15, 2024
1 parent 4ba3d37 commit c366304
Show file tree
Hide file tree
Showing 3 changed files with 115 additions and 1 deletion.
84 changes: 84 additions & 0 deletions ci/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,62 @@ groups:
- build-edge-image
- release
- release-docker
- set-dev-version

plan:
- in_parallel:
- { get: repo, passed: [release] }
- { get: pipeline-tasks }
- get: version
trigger: true
params: { bump: patch }
passed: [release]
- task: set-dev-version
config:
image_resource: #@ release_task_image_config()
platform: linux
inputs:
- name: version
- name: repo
- name: pipeline-tasks
outputs:
- name: repo
run:
path: pipeline-tasks/ci/tasks/set-dev-version.sh
params:
BRANCH: #@ data.values.git_branch
- put: repo
params:
repository: repo
rebase: true

- name: set-dev-version
plan:
- in_parallel:
- { get: repo, passed: [release] }
- { get: pipeline-tasks }
- get: version
trigger: true
params: { bump: patch }
passed: [release]
- task: set-dev-version
config:
image_resource: #@ release_task_image_config()
platform: linux
inputs:
- name: version
- name: repo
- name: pipeline-tasks
outputs:
- name: repo
run:
path: pipeline-tasks/ci/tasks/set-dev-version.sh
params:
BRANCH: #@ data.values.git_branch
- put: repo
params:
repository: repo
rebase: true

jobs:
- #@ rust_check_code()
Expand Down Expand Up @@ -254,6 +310,34 @@ jobs:
image: image/image.tar
additional_tags: version/version

- name: set-dev-version
plan:
- in_parallel:
- { get: repo, passed: [release] }
- { get: pipeline-tasks }
- get: version
trigger: true
params: { bump: patch }
passed: [release]
- task: set-dev-version
config:
image_resource: #@ release_task_image_config()
platform: linux
inputs:
- name: version
- name: repo
- name: pipeline-tasks
outputs:
- name: repo
run:
path: pipeline-tasks/ci/tasks/set-dev-version.sh
params:
BRANCH: #@ data.values.git_branch
- put: repo
params:
repository: repo
rebase: true

resources:
- #@ repo_resource(True)
- #@ pipeline_tasks_resource()
Expand Down
2 changes: 1 addition & 1 deletion ci/tasks/publish-to-crates.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ EOF

cargo publish -p cala-cel-parser --all-features --no-verify
cargo publish -p cala-cel-interpreter --all-features --no-verify
cargo publish -p cala-core-types --all-features --no-verify
cargo publish -p cala-ledger-core-types --all-features --no-verify
cargo publish -p cala-ledger-outbox-client --all-features --no-verify
cargo publish -p cala-ledger --all-features --no-verify
cargo publish -p cala-server --all-features --no-verify
30 changes: 30 additions & 0 deletions ci/tasks/set-dev-version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash

VERSION="$(cat version/version)-dev"

pushd repo

for file in $(find . -mindepth 2 -name Cargo.toml); do
sed -i'' "s/^version.*/version = \"${VERSION}\"/" ${file}
done

sed -i'' "s/cala-cel-parser\", version = .*/cala-cel-parser\", version = \"${VERSION}\" }/" cala-cel-parser/Cargo.toml
sed -i'' "s/cala-cel-interpreter\", version = .*/cala-cel-interpreter\", version = \"${VERSION}\" }/" cala-cel-interpreter/Cargo.toml
sed -i'' "s/cala-ledger-core-types\", version = .*/cala-ledger-core-types\", version = \"${VERSION}\" }/" cala-ledger-core-types/Cargo.toml
sed -i'' "s/cala-ledger-outbox-client\", version = .*/cala-ledger-outbox-client\", version = \"${VERSION}\" }/" cala-ledger-outbox-client/Cargo.toml
sed -i'' "s/cala-ledger\", version = .*/cala-ledger\", version = \"${VERSION}\" }/" cala-ledger/Cargo.toml
sed -i'' "s/cala-server\", version = .*/cala-server\", version = \"${VERSION}\" }/" cala-server/Cargo.toml

if [[ -z $(git config --global user.email) ]]; then
git config --global user.email "[email protected]"
fi
if [[ -z $(git config --global user.name) ]]; then
git config --global user.name "CI Bot"
fi

git status
git add -A

if [[ "$(git status -s -uno)" != "" ]]; then
git commit -m "ci(dev): set version to ${VERSION}"
fi

0 comments on commit c366304

Please sign in to comment.