chore: update script
Rust / build (macos-latest, stable) (push) Waiting to run
Rust / build (ubuntu-latest, stable) (push) Waiting to run
Rust / build (windows-latest, stable) (push) Waiting to run
Build and Release / Build macos-x64 (push) Waiting to run
Build and Release / Build macos-arm64 (push) Waiting to run
Build and Release / Build linux-arm64 (push) Waiting to run
Build and Release / Build linux-x64 (push) Waiting to run
Build and Release / Build windows-arm64 (push) Waiting to run
Build and Release / Build windows-x64 (push) Waiting to run
Build and Release / Create Release (push) Blocked by required conditions
Rust / build (macos-latest, stable) (push) Waiting to run
Rust / build (ubuntu-latest, stable) (push) Waiting to run
Rust / build (windows-latest, stable) (push) Waiting to run
Build and Release / Build macos-x64 (push) Waiting to run
Build and Release / Build macos-arm64 (push) Waiting to run
Build and Release / Build linux-arm64 (push) Waiting to run
Build and Release / Build linux-x64 (push) Waiting to run
Build and Release / Build windows-arm64 (push) Waiting to run
Build and Release / Build windows-x64 (push) Waiting to run
Build and Release / Create Release (push) Blocked by required conditions
This commit is contained in:
@@ -159,7 +159,7 @@ jobs:
|
|||||||
id: create_release
|
id: create_release
|
||||||
uses: akkuman/gitea-release-action@v1
|
uses: akkuman/gitea-release-action@v1
|
||||||
with:
|
with:
|
||||||
server_url: "https://git.reya.su/"
|
server_url: "https://git.reya.info/"
|
||||||
repository: "reya/signed"
|
repository: "reya/signed"
|
||||||
token: ${{ secrets.GITEA_TOKEN }}
|
token: ${{ secrets.GITEA_TOKEN }}
|
||||||
draft: true
|
draft: true
|
||||||
|
|||||||
+63
-51
@@ -54,66 +54,78 @@ echo "Updating versions..."
|
|||||||
update_version "$WORKSPACE_CARGO"
|
update_version "$WORKSPACE_CARGO"
|
||||||
update_version "$CRATE_CARGO"
|
update_version "$CRATE_CARGO"
|
||||||
|
|
||||||
# Check git status before committing
|
|
||||||
echo "Checking git status..."
|
|
||||||
if git status --porcelain | grep -q .; then
|
|
||||||
echo "Current uncommitted changes:"
|
|
||||||
git status --short
|
|
||||||
|
|
||||||
# Ask user if they want to commit all changes or just version files
|
|
||||||
echo ""
|
|
||||||
echo "Do you want to:"
|
|
||||||
echo "1) Commit all current changes (including the version updates)"
|
|
||||||
echo "2) Commit only the version file changes"
|
|
||||||
echo "3) Abort the release"
|
|
||||||
read -p "Enter choice (1/2/3): " choice
|
|
||||||
|
|
||||||
case $choice in
|
|
||||||
1)
|
|
||||||
echo "Committing all changes..."
|
|
||||||
git add .
|
|
||||||
;;
|
|
||||||
2)
|
|
||||||
echo "Committing only version file changes..."
|
|
||||||
git add "$WORKSPACE_CARGO" "$CRATE_CARGO"
|
|
||||||
;;
|
|
||||||
3)
|
|
||||||
echo "Release aborted by user"
|
|
||||||
exit 0
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo "Invalid choice. Release aborted."
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
else
|
|
||||||
# Only version files were modified, add them specifically
|
|
||||||
echo "Only version files were modified, adding them for commit..."
|
|
||||||
git add "$WORKSPACE_CARGO" "$CRATE_CARGO"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Commit the changes
|
|
||||||
COMMIT_MSG="chore: release version $NEW_VERSION"
|
COMMIT_MSG="chore: release version $NEW_VERSION"
|
||||||
|
|
||||||
if git commit -m "$COMMIT_MSG"; then
|
# When the requested version is already set there is nothing to bump or commit,
|
||||||
echo "✓ Committed version changes"
|
# so the current commit is tagged as-is.
|
||||||
|
if git diff --quiet -- "$WORKSPACE_CARGO" "$CRATE_CARGO"; then
|
||||||
|
echo "Version is already $NEW_VERSION, tagging the current commit"
|
||||||
else
|
else
|
||||||
echo "Error: Failed to commit version changes"
|
# Check git status before committing
|
||||||
exit 1
|
echo "Checking git status..."
|
||||||
fi
|
# The version files are always modified at this point, so only ask about other changes.
|
||||||
|
if [ -n "$(git status --porcelain -- . ":(exclude,top)$WORKSPACE_CARGO" ":(exclude,top)$CRATE_CARGO")" ]; then
|
||||||
|
echo "Current uncommitted changes:"
|
||||||
|
git status --short
|
||||||
|
|
||||||
# Push version changes to origin
|
# Ask user if they want to commit all changes or just version files
|
||||||
echo "Pushing version changes to origin..."
|
echo ""
|
||||||
if git push origin master; then
|
echo "Do you want to:"
|
||||||
echo "✓ Successfully pushed version changes to origin"
|
echo "1) Commit all current changes (including the version updates)"
|
||||||
else
|
echo "2) Commit only the version file changes"
|
||||||
echo "Error: Failed to push version changes to origin"
|
echo "3) Abort the release"
|
||||||
exit 1
|
read -p "Enter choice (1/2/3): " choice
|
||||||
|
|
||||||
|
case $choice in
|
||||||
|
1)
|
||||||
|
echo "Committing all changes..."
|
||||||
|
git add .
|
||||||
|
;;
|
||||||
|
2)
|
||||||
|
echo "Committing only version file changes..."
|
||||||
|
git add "$WORKSPACE_CARGO" "$CRATE_CARGO"
|
||||||
|
;;
|
||||||
|
3)
|
||||||
|
echo "Release aborted by user"
|
||||||
|
exit 0
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Invalid choice. Release aborted."
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
else
|
||||||
|
# Only version files were modified, add them specifically
|
||||||
|
echo "Only version files were modified, adding them for commit..."
|
||||||
|
git add "$WORKSPACE_CARGO" "$CRATE_CARGO"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Commit the changes
|
||||||
|
if git commit -m "$COMMIT_MSG"; then
|
||||||
|
echo "✓ Committed version changes"
|
||||||
|
else
|
||||||
|
echo "Error: Failed to commit version changes"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Push version changes to origin
|
||||||
|
echo "Pushing version changes to origin..."
|
||||||
|
if git push origin master; then
|
||||||
|
echo "✓ Successfully pushed version changes to origin"
|
||||||
|
else
|
||||||
|
echo "Error: Failed to push version changes to origin"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Create git tag
|
# Create git tag
|
||||||
TAG_NAME="v$NEW_VERSION"
|
TAG_NAME="v$NEW_VERSION"
|
||||||
|
|
||||||
|
if git rev-parse -q --verify "refs/tags/$TAG_NAME" >/dev/null; then
|
||||||
|
echo "Error: tag $TAG_NAME already exists"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
if git tag -a "$TAG_NAME" -m "$COMMIT_MSG"; then
|
if git tag -a "$TAG_NAME" -m "$COMMIT_MSG"; then
|
||||||
echo "✓ Created git tag: $TAG_NAME"
|
echo "✓ Created git tag: $TAG_NAME"
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user