Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
305 changes: 153 additions & 152 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -274,163 +274,164 @@ jobs:
sed -i 's/^version = ".*"/version = "${{ env.VERSION_NAME }}"/' crates/sdk/Cargo.toml
sed -i 's/^version = ".*"/version = "${{ env.VERSION_NAME }}"/' Cargo.toml

- name: Update Changelog
shell: bash
run: |
CHANGELOG_FILE="documentation/rrelayer/docs/pages/changelog.mdx"
DAY=$(date '+%d' | sed 's/^0*//')
MONTH=$(date '+%B')
YEAR=$(date '+%Y')

# Add ordinal suffix
case $DAY in
1|21|31) SUFFIX="st";;
2|22) SUFFIX="nd";;
3|23) SUFFIX="rd";;
*) SUFFIX="th";;
esac

DATE="$DAY$SUFFIX $MONTH $YEAR"

echo "Updating changelog for version ${{ env.VERSION_NAME }}"

# Create changelog if it doesn't exist
if [[ ! -f "$CHANGELOG_FILE" ]]; then
cat > "$CHANGELOG_FILE" << EOF
# Changelog

## Changes Not Deployed
-------------------------------------------------

### Features
-------------------------------------------------

### Bug fixes
-------------------------------------------------

### Breaking changes
-------------------------------------------------

## Releases
-------------------------------------------------

all release branches are deployed through \`release/VERSION_NUMBER\` branches

EOF
fi

# Create a temporary file to work with
cp "$CHANGELOG_FILE" changelog_temp.md

# Extract just the bug fixes line directly from Changes Not Deployed section
BUG_FIXES=$(sed -n '/^## Changes Not Deployed/,/^## Releases/p' changelog_temp.md | grep "^- fix:" | head -5)

# Use the simple extraction for now
FEATURES=""
BUG_FIXES="$BUG_FIXES"
BREAKING_CHANGES=""

# Save the extracted content for PR creation
{
echo "### Changes in this release:"
echo "-------------------------------------------------"
echo "### Features"
echo "-------------------------------------------------"
if [[ -n "$FEATURES" ]]; then
echo "$FEATURES"
fi
echo ""
echo "### Bug fixes"
echo "-------------------------------------------------"
if [[ -n "$BUG_FIXES" ]]; then
echo "$BUG_FIXES"
fi
echo ""
echo "### Breaking changes"
echo "-------------------------------------------------"
if [[ -n "$BREAKING_CHANGES" ]]; then
echo "$BREAKING_CHANGES"
fi
} > pr_body_content.txt

# Save to environment variable
echo "PR_BODY_CONTENT<<EOF" >> $GITHUB_ENV
cat pr_body_content.txt >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV

# Create new release entry
cat > new_release.txt << EOF
# ${{ env.VERSION_NAME }}-beta - $DATE

github branch - https://github.com/joshstevens19/rrelayer/tree/release/${{ env.VERSION_NAME }}

- linux binary - https://github.com/joshstevens19/rrelayer/releases/download/v${{ env.VERSION_NAME }}/rrelayer_linux-amd64.tar.gz
- mac apple silicon binary - https://github.com/joshstevens19/rrelayer/releases/download/v${{ env.VERSION_NAME }}/rrelayer_darwin-arm64.tar.gz
- mac apple intel binary - https://github.com/joshstevens19/rrelayer/releases/download/v${{ env.VERSION_NAME }}/rrelayer_darwin-amd64.tar.gz
- windows binary - https://github.com/joshstevens19/rrelayer/releases/download/v${{ env.VERSION_NAME }}/rrelayer_win32-amd64.zip
EOF

# Add sections if they have content
if [[ -n "$FEATURES" && "$FEATURES" =~ [^[:space:]] ]]; then
echo "" >> new_release.txt
echo "### Features" >> new_release.txt
echo "-------------------------------------------------" >> new_release.txt
echo "$FEATURES" >> new_release.txt
fi

if [[ -n "$BUG_FIXES" && "$BUG_FIXES" =~ [^[:space:]] ]]; then
echo "" >> new_release.txt
echo "### Bug fixes" >> new_release.txt
echo "-------------------------------------------------" >> new_release.txt
echo "$BUG_FIXES" >> new_release.txt
fi

if [[ -n "$BREAKING_CHANGES" && "$BREAKING_CHANGES" =~ [^[:space:]] ]]; then
echo "" >> new_release.txt
echo "### Breaking changes" >> new_release.txt
echo "-------------------------------------------------" >> new_release.txt
echo "$BREAKING_CHANGES" >> new_release.txt
fi

# Get existing releases (everything after "## Releases")
EXISTING_RELEASES=$(awk '/^## Releases/,0' changelog_temp.md | tail -n +5)

# Create new changelog
cat > "$CHANGELOG_FILE" << EOF
# Changelog

## Changes Not Deployed
-------------------------------------------------

### Features
-------------------------------------------------

### Bug fixes
-------------------------------------------------

### Breaking changes
-------------------------------------------------

## Releases
-------------------------------------------------

all release branches are deployed through \`release/VERSION_NUMBER\` branches

$(cat new_release.txt)

$EXISTING_RELEASES
EOF

# Clean up temporary files
rm -f changelog_temp.md new_release.txt pr_body_content.txt

echo "Changelog updated successfully"
# Temporarily commented out changelog update for release process
# - name: Update Changelog
# shell: bash
# run: |
# CHANGELOG_FILE="documentation/rrelayer/docs/pages/changelog.mdx"
# DAY=$(date '+%d' | sed 's/^0*//')
# MONTH=$(date '+%B')
# YEAR=$(date '+%Y')
#
# # Add ordinal suffix
# case $DAY in
# 1|21|31) SUFFIX="st";;
# 2|22) SUFFIX="nd";;
# 3|23) SUFFIX="rd";;
# *) SUFFIX="th";;
# esac
#
# DATE="$DAY$SUFFIX $MONTH $YEAR"
#
# echo "Updating changelog for version ${{ env.VERSION_NAME }}"
#
# # Create changelog if it doesn't exist
# if [[ ! -f "$CHANGELOG_FILE" ]]; then
# cat > "$CHANGELOG_FILE" << EOF
# # Changelog
#
# ## Changes Not Deployed
# -------------------------------------------------
#
# ### Features
# -------------------------------------------------
#
# ### Bug fixes
# -------------------------------------------------
#
# ### Breaking changes
# -------------------------------------------------
#
# ## Releases
# -------------------------------------------------
#
# all release branches are deployed through \`release/VERSION_NUMBER\` branches
#
# EOF
# fi
#
# # Create a temporary file to work with
# cp "$CHANGELOG_FILE" changelog_temp.md
#
# # Extract just the bug fixes line directly from Changes Not Deployed section
# BUG_FIXES=$(sed -n '/^## Changes Not Deployed/,/^## Releases/p' changelog_temp.md | grep "^- fix:" | head -5)
#
# # Use the simple extraction for now
# FEATURES=""
# BUG_FIXES="$BUG_FIXES"
# BREAKING_CHANGES=""
#
# # Save the extracted content for PR creation
# {
# echo "### Changes in this release:"
# echo "-------------------------------------------------"
# echo "### Features"
# echo "-------------------------------------------------"
# if [[ -n "$FEATURES" ]]; then
# echo "$FEATURES"
# fi
# echo ""
# echo "### Bug fixes"
# echo "-------------------------------------------------"
# if [[ -n "$BUG_FIXES" ]]; then
# echo "$BUG_FIXES"
# fi
# echo ""
# echo "### Breaking changes"
# echo "-------------------------------------------------"
# if [[ -n "$BREAKING_CHANGES" ]]; then
# echo "$BREAKING_CHANGES"
# fi
# } > pr_body_content.txt
#
# # Save to environment variable
# echo "PR_BODY_CONTENT<<EOF" >> $GITHUB_ENV
# cat pr_body_content.txt >> $GITHUB_ENV
# echo "EOF" >> $GITHUB_ENV
#
# # Create new release entry
# cat > new_release.txt << EOF
# # ${{ env.VERSION_NAME }}-beta - $DATE
#
# github branch - https://github.com/joshstevens19/rrelayer/tree/release/${{ env.VERSION_NAME }}
#
# - linux binary - https://github.com/joshstevens19/rrelayer/releases/download/v${{ env.VERSION_NAME }}/rrelayer_linux-amd64.tar.gz
# - mac apple silicon binary - https://github.com/joshstevens19/rrelayer/releases/download/v${{ env.VERSION_NAME }}/rrelayer_darwin-arm64.tar.gz
# - mac apple intel binary - https://github.com/joshstevens19/rrelayer/releases/download/v${{ env.VERSION_NAME }}/rrelayer_darwin-amd64.tar.gz
# - windows binary - https://github.com/joshstevens19/rrelayer/releases/download/v${{ env.VERSION_NAME }}/rrelayer_win32-amd64.zip
# EOF
#
# # Add sections if they have content
# if [[ -n "$FEATURES" && "$FEATURES" =~ [^[:space:]] ]]; then
# echo "" >> new_release.txt
# echo "### Features" >> new_release.txt
# echo "-------------------------------------------------" >> new_release.txt
# echo "$FEATURES" >> new_release.txt
# fi
#
# if [[ -n "$BUG_FIXES" && "$BUG_FIXES" =~ [^[:space:]] ]]; then
# echo "" >> new_release.txt
# echo "### Bug fixes" >> new_release.txt
# echo "-------------------------------------------------" >> new_release.txt
# echo "$BUG_FIXES" >> new_release.txt
# fi
#
# if [[ -n "$BREAKING_CHANGES" && "$BREAKING_CHANGES" =~ [^[:space:]] ]]; then
# echo "" >> new_release.txt
# echo "### Breaking changes" >> new_release.txt
# echo "-------------------------------------------------" >> new_release.txt
# echo "$BREAKING_CHANGES" >> new_release.txt
# fi
#
# # Get existing releases (everything after "## Releases")
# EXISTING_RELEASES=$(awk '/^## Releases/,0' changelog_temp.md | tail -n +5)
#
# # Create new changelog
# cat > "$CHANGELOG_FILE" << EOF
# # Changelog
#
# ## Changes Not Deployed
# -------------------------------------------------
#
# ### Features
# -------------------------------------------------
#
# ### Bug fixes
# -------------------------------------------------
#
# ### Breaking changes
# -------------------------------------------------
#
# ## Releases
# -------------------------------------------------
#
# all release branches are deployed through \`release/VERSION_NUMBER\` branches
#
# $(cat new_release.txt)
#
# $EXISTING_RELEASES
# EOF
#
# # Clean up temporary files
# rm -f changelog_temp.md new_release.txt pr_body_content.txt
#
# echo "Changelog updated successfully"

- name: Commit changes
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add crates/cli/Cargo.toml crates/core/Cargo.toml crates/sdk/Cargo.toml Cargo.toml documentation/rrelayer/docs/pages/changelog.mdx
git add crates/cli/Cargo.toml crates/core/Cargo.toml crates/sdk/Cargo.toml Cargo.toml
git commit -m "Release v${{ env.VERSION_NAME }}"
git push origin release/${{ env.VERSION_NAME }}

Expand Down
2 changes: 1 addition & 1 deletion crates/cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rrelayer_cli"
version = "0.1.0"
version = "0.1.1"
edition = "2024"

[dependencies]
Expand Down
2 changes: 1 addition & 1 deletion crates/core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rrelayer_core"
version = "0.1.0"
version = "0.1.1"
resolver = "2"
edition = "2021"
authors = ["[email protected]"]
Expand Down
2 changes: 1 addition & 1 deletion crates/sdk/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rrelayer"
version = "0.1.0"
version = "0.1.1"
edition = "2024"
authors = ["[email protected]"]
license = "MIT"
Expand Down