diff options
Diffstat (limited to 'scripts')
| -rwxr-xr-x | scripts/deploy-docs.sh | 48 | ||||
| -rwxr-xr-x | scripts/is-branch.sh | 39 | ||||
| -rwxr-xr-x | scripts/release.sh | 26 |
3 files changed, 2 insertions, 111 deletions
diff --git a/scripts/deploy-docs.sh b/scripts/deploy-docs.sh deleted file mode 100755 index 194882a..0000000 --- a/scripts/deploy-docs.sh +++ /dev/null @@ -1,48 +0,0 @@ -#!/usr/bin/env bash -set -eou pipefail - -source "$(dirname "${BASH_SOURCE[0]}")/lib/log.sh" -source "$(dirname "${BASH_SOURCE[0]}")/lib/path.sh" - -readonly SITE="bolt.eugenetriguba.com" - -usage() { - echo "Usage: $0" - echo "" - echo "Build and deploy documentation to SourceHut Pages" - echo "" - echo "Examples:" - echo " $0 # Build and deploy docs to $SITE" -} - -main() { - if [[ "${1:-}" == "-h" || "${1:-}" == "--help" ]]; then - usage - exit 0 - fi - - log_header "Deploying Documentation" - build_docs - package_site - deploy_to_pages -} - -build_docs() { - log_step "Building documentation with MkDocs" - mkdocs build - log_success "Documentation built successfully" -} - -package_site() { - log_step "Creating tarball" - tar -C site -czf site.tar.gz . - log_success "Site packaged as site.tar.gz" -} - -deploy_to_pages() { - log_step "Deploying to SourceHut Pages: $SITE" - hut pages publish -d "$SITE" site.tar.gz - log_success "Documentation deployed to https://$SITE" -} - -main "$@" diff --git a/scripts/is-branch.sh b/scripts/is-branch.sh deleted file mode 100755 index 7bba709..0000000 --- a/scripts/is-branch.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/usr/bin/env bash -set -eou pipefail - -source "$(dirname "${BASH_SOURCE[0]}")/lib/log.sh" - -TARGET_BRANCH="" - -main() { - if [[ $# -ne 1 ]]; then - echo "Usage: $0 <target-branch>" >&2 - exit 1 - fi - TARGET_BRANCH="$1" - local -r current_branch=$(get_current_branch) - - if [[ "$current_branch" != "$TARGET_BRANCH" ]]; then - log_warn "Not on $TARGET_BRANCH branch (current branch is $current_branch)" - exit 2 - fi - log_info "On $TARGET_BRANCH branch" -} - -get_current_branch() { - # build.sr.ht automatically injects the GIT_REF environment variable - # - GIT_REF: Git reference which triggered the build (e.g. refs/heads/master) - # - # See https://man.sr.ht/builds.sr.ht/ - local current_branch="${GIT_REF:-}" - if [[ -z "$current_branch" ]]; then - current_branch=$(git rev-parse --abbrev-ref HEAD) - else - # Strip refs/heads/ prefix if present - # GIT_REF, if set, should be in the format: refs/heads/<branch-name> - current_branch="${current_branch#refs/heads/}" - fi - echo "$current_branch" -} - -main "$@" diff --git a/scripts/release.sh b/scripts/release.sh index aeb90e3..b914b9f 100755 --- a/scripts/release.sh +++ b/scripts/release.sh @@ -7,8 +7,6 @@ source "$(dirname "${BASH_SOURCE[0]}")/lib/path.sh" readonly VERSION_FILE="$PATH_PROJECT_DIR/internal/commands/version.go" readonly CHANGELOG_FILE="$PATH_PROJECT_DIR/CHANGELOG.md" readonly README_FILE="$PATH_PROJECT_DIR/README.md" -readonly DOCS_INDEX_FILE="$PATH_PROJECT_DIR/docs/index.md" -readonly DOCS_INSTALLATION_FILE="$PATH_PROJECT_DIR/docs/installation.md" usage() { echo "Usage: $0 <version>" @@ -51,8 +49,6 @@ main() { update_version_file "$current_version" "$new_version" update_readme "$current_version" "$new_version" - update_docs_index "$current_version" "$new_version" - update_docs_installation "$current_version" "$new_version" update_changelog "$new_version" show_changes @@ -139,24 +135,6 @@ update_readme() { mv "$README_FILE.tmp" "$README_FILE" } -update_docs_index() { - local old_version="$1" - local new_version="$2" - - log_step "Updating version in $DOCS_INDEX_FILE" - sed "s/version-$old_version-blue/version-$new_version-blue/g; s|bolt/cmd/bolt@v$old_version|bolt/cmd/bolt@v$new_version|g" "$DOCS_INDEX_FILE" >"$DOCS_INDEX_FILE.tmp" - mv "$DOCS_INDEX_FILE.tmp" "$DOCS_INDEX_FILE" -} - -update_docs_installation() { - local old_version="$1" - local new_version="$2" - - log_step "Updating version in $DOCS_INSTALLATION_FILE" - sed "s|bolt/cmd/bolt@v$old_version|bolt/cmd/bolt@v$new_version|g" "$DOCS_INSTALLATION_FILE" >"$DOCS_INSTALLATION_FILE.tmp" - mv "$DOCS_INSTALLATION_FILE.tmp" "$DOCS_INSTALLATION_FILE" -} - update_changelog() { local new_version="$1" local today @@ -186,7 +164,7 @@ update_changelog() { show_changes() { log_newline log_step "Changes to be committed:" - git diff "$VERSION_FILE" "$README_FILE" "$DOCS_INDEX_FILE" "$DOCS_INSTALLATION_FILE" "$CHANGELOG_FILE" + git diff "$VERSION_FILE" "$README_FILE" "$CHANGELOG_FILE" } confirm_release() { @@ -204,7 +182,7 @@ create_release_commit() { local version="$1" log_step "Creating release commit" - git add "$VERSION_FILE" "$README_FILE" "$DOCS_INDEX_FILE" "$DOCS_INSTALLATION_FILE" "$CHANGELOG_FILE" + git add "$VERSION_FILE" "$README_FILE" "$CHANGELOG_FILE" git commit -m "Release v$version" } |