Skip to content

Commit

Permalink
Merge pull request #218 from jerus-org/change-release
Browse files Browse the repository at this point in the history
feat: add change release for pcu release
  • Loading branch information
jerusdp authored Jul 24, 2024
2 parents 058b082 + 83c15cd commit 3bf8176
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 8 deletions.
73 changes: 65 additions & 8 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ jobs:

make_release:
executor: rust-env

parameters:
ssh_fingerprint:
type: string
Expand All @@ -180,6 +181,26 @@ jobs:
type: string
default: "-vv"
description: "The verbosity of the pcu command"
version:
type: string
default: ""
description: |
Specific version number to release
specific_version:
type: boolean
default: false
description: |
Make a specific release, if true version must be set to the specific version number
publish:
type: boolean
default: true
description: |
Publish the release
first_release:
type: boolean
default: false
description: |
Request that a first release (v0.1.0) be created
steps:
- checkout
- add_ssh_keys:
Expand Down Expand Up @@ -207,20 +228,56 @@ jobs:
# && echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | tee /etc/apt/sources.list.d/github-cli.list > /dev/null \
# && apt update \
# && apt install gh -y
# - run:
# name: Check gh authentication
# command: |
# gh auth status
# gh config set git_protocol ssh --host github.com
# gh auth status
# # echo $GITHUB_TOKEN | gh auth login --with-token
# # gh auth status
- run:
name: Check gh authentication
name: Create Github release
command: |
gh auth status
gh config set git_protocol ssh --host github.com
gh auth status
# echo $GITHUB_TOKEN | gh auth login --with-token
# gh auth status
set -exo pipefail
version=$(nextsv -bn calculate)
echo $"export SEMVER='$version'" >> $BASH_ENV
- run:
name: Find next level and publish update
command: |
set -exo pipefail
if [ "<< parameters.publish >>" == "true" ] ; then
publish="--publish"
else
publish="--no-publish"
fi
cargo release changes
if [ "<< parameters.first_release >>" == "true" ] ; then
cargo release $publish --execute --no-confirm --sign-tag -c first-release.toml 0.1.0
else
if [ "<< parameters.specific_version >>" == "true" ] && [ "<< parameters.version >>" != "" ] ; then
export NEXTSV_LEVEL=<< parameters.version >>
else
export NEXTSV_LEVEL=$(nextsv -q -c other require -f CHANGELOG.md feature)
fi
echo $NEXTSV_LEVEL
if [ $NEXTSV_LEVEL != "none" ] ; then
cargo release changes
cargo release "$publish" --execute --no-confirm --sign-tag "$NEXTSV_LEVEL"
else
echo "Not ready to release yet."
fi
fi
- run:
name: Create Github release
command: |
set -exo pipefail
version=$(nextsv -bn calculate)
pcu <<parameters.pcu_verbosity>> release --release ${version}
pcu <<parameters.pcu_verbosity>> release --semver ${SEMVER}
ls -l
cat release_notes.md
head -n 20 CHANGELOG.md
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- add condition to update changelog in run_release function and refactor cli to module(pr [#215])
- add get_commitish_for_tag and refactor make_release function(pr [#217])
- add change release for pcu release(pr [#218])

### Security

Expand Down Expand Up @@ -284,6 +285,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
[#215]: https://github.com/jerus-org/pcu/pull/215
[#216]: https://github.com/jerus-org/pcu/pull/216
[#217]: https://github.com/jerus-org/pcu/pull/217
[#218]: https://github.com/jerus-org/pcu/pull/218
[Unreleased]: https://github.com/jerus-org/pcu/compare/0.1.11...HEAD
[0.1.11]: https://github.com/jerus-org/pcu/compare/0.1.10...0.1.11
[0.1.10]: https://github.com/jerus-org/pcu/compare/0.1.9...0.1.10
Expand Down

0 comments on commit 3bf8176

Please sign in to comment.