Skip to content

Commit

Permalink
kick yet again
Browse files Browse the repository at this point in the history
  • Loading branch information
Kim Neunert committed May 28, 2024
1 parent 515b788 commit b09f315
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 12 deletions.
8 changes: 4 additions & 4 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -263,8 +263,8 @@ update_github:
# write access to [email protected]:swan-bitcoin/specter-static.git
- source ./utils/prepare_for_git_write.sh "$SSH_SPECTERSTATIC_DEPLOY_KEY"
script:
- echo "Now updating https://github.com:${CI_PROJECT_ROOT_NAMESPACE}/specterext-dummy.git"
- ./utils/generate_downloadpage.sh --org_name ${CI_PROJECT_ROOT_NAMESPACE:-k9ert} --debug --version ${CI_COMMIT_TAG:-v0.0.0-pre3} generate github # default-value for testing
- echo "Now updating https://github.com:${CI_PROJECT_ROOT_NAMESPACE}/specter-desktop/releases/tag/${CI_COMMIT_TAG:-v2.0.4-pre8}"
- ./utils/generate_downloadpage.sh --org_name ${CI_PROJECT_ROOT_NAMESPACE:-k9ert} --debug --version ${CI_COMMIT_TAG:-v2.0.4-pre8} generate github # default-value for testing

# update github
update_webpage:
Expand All @@ -275,6 +275,6 @@ update_webpage:
# write access to [email protected]:swan-bitcoin/specter-static.git
- source ./utils/prepare_for_git_write.sh "$SSH_SPECTERSTATIC_DEPLOY_KEY"
script:
- echo "Now updating https://github.com:${CI_PROJECT_ROOT_NAMESPACE}/specterext-dummy.git"
- ./utils/generate_downloadpage.sh --org_name ${CI_PROJECT_ROOT_NAMESPACE:-k9ert} --debug --version ${CI_COMMIT_TAG:-v0.0.0-pre3} generate webpage # default-value for testing
- echo "Now updating https://github.com:${CI_PROJECT_ROOT_NAMESPACE}/specter-static.git"
- ./utils/generate_downloadpage.sh --org_name ${CI_PROJECT_ROOT_NAMESPACE:-k9ert} --debug --version ${CI_COMMIT_TAG:-v2.0.4-pre8} generate webpage # default-value for testing

30 changes: 22 additions & 8 deletions utils/generate_downloadpage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,13 @@ function generate {
}

function update_github {
# Determine the platform and execute the appropriate function
platform="$(uname -s)"
case "${platform}" in
Linux*) install_gh_linux;;
Darwin*) install_gh_macos;;
*) echo "Unsupported platform: ${platform}"; exit 1;;
esac
if ! command -v gh &> /dev/null; then
echo "WARNING: 'gh' binary not found or not executable. Please ensure it is installed and in your PATH."
echo "You need now to manually replace the release-Notes. I'll list them here:"
Expand All @@ -101,13 +108,20 @@ function update_github {
}

function update_webpage {
if [[ $version =~ -pre[0-9]+$ ]]; then
if [[ "$org_name" = "swan-bitcoin" ]]; then
echo "The version has a pre-release suffix. Exiting..."
return 0
fi
echo "we have a pre-release but continuing for testing purposes anyway"
fi
if ! [[ -d ../../specter-static ]]; then
echo "You don't have cloned the specter-static repo."
echo "doing that now"
git clone [email protected]:swan-bitcoin/specter-static.git
specter_static_folder=./specter-static
echo "You don't have cloned the specter-static repo."
echo "doing that now"
git clone [email protected]:swan-bitcoin/specter-static.git
specter_static_folder=./specter-static
else
specter_static_folder=../../specter-static
specter_static_folder=../../specter-static
fi
target_file=${specter_static_folder}/specter-httrack-src/specter.solutions/downloads/index.html

Expand All @@ -118,8 +132,8 @@ function update_webpage {

# Check if working directory is clean
if git diff --quiet && git diff --staged --quiet; then
echo "Git working directory is clean. Exiting..."
exit 0
echo "Git working directory is clean. Exiting..."
exit 0
fi

# Add the file to the staging area
Expand All @@ -131,7 +145,7 @@ function update_webpage {
# Push the commit
#read -p "Push commit to remote? (y/n): " confirm
#if [[ $confirm =~ ^[Yy]$ ]]; then
#git push
git push
#else
# echo "Push aborted."
# exit 1
Expand Down

0 comments on commit b09f315

Please sign in to comment.