Skip to content

ci: fix release #30

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
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
8 changes: 3 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ jobs:
with:
fetch-depth: 0
token: ${{ steps.app-token.outputs.token }}
persist-credentials: false

- name: Configure Git
run: |
Expand Down Expand Up @@ -76,7 +75,7 @@ jobs:
- name: Commit changes to main
id: commit-changes
run: |
git add Cargo.toml CHANGELOG.md
git add Cargo.toml Cargo.lock CHANGELOG.md
git commit -m "release(zParse): version $VERSION [skip ci]"
git push origin HEAD:main
echo "commit_sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
Expand Down Expand Up @@ -129,7 +128,7 @@ jobs:
id: release-notes
if: matrix.platform.os == 'ubuntu-latest'
run: |
VERSION=${needs.prepare-release.outputs.version}
VERSION=${{ needs.prepare-release.outputs.version }}
NOTES=$(awk -v ver="$VERSION" '
/^## \[/ { if (p) { exit }; if ($2 == "['ver']") { p=1; next } }
p { print }
Expand All @@ -156,15 +155,14 @@ jobs:
- name: Install cross-compilation tools
if: matrix.platform.target == 'aarch64-apple-darwin'
run: |
brew install FiloSottile/musl-cross/musl-cross
rustup target add aarch64-apple-darwin

# Build the specific package
- name: Build Binary
run: |
cargo build --release --target ${{ matrix.platform.target }} -p ${{ env.PROJECT_NAME }}
env:
CARGO_TARGET_AARCH64_APPLE_DARWIN_LINKER: aarch64-apple-darwin-gcc
CARGO_TARGET_AARCH64_APPLE_DARWIN_LINKER: clang

- name: Prepare Asset
shell: bash
Expand Down
12 changes: 6 additions & 6 deletions scripts/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ validate_changelog() {
echo "Please update CHANGELOG.md before releasing"
exit 1
fi

if grep -q "\[$VERSION\]" CHANGELOG.md; then
echo "Warning: Version $VERSION already exists in CHANGELOG.md"
echo "This may cause issues with the automated release process"
Expand All @@ -53,17 +53,17 @@ create_tag() {
echo "Error: You must be on the main branch to create a release tag"
exit 1
fi

# Ensure working directory is clean
if ! git diff-index --quiet HEAD --; then
echo "Error: You have uncommitted changes"
echo "Please commit or stash them before creating a release"
exit 1
fi

# Validate changelog
validate_changelog

# Confirm with user
echo "This will create and push tag v$VERSION, triggering the release workflow."
echo "Changelog entries from the [Unreleased] section will be moved to version $VERSION."
Expand All @@ -72,7 +72,7 @@ create_tag() {
echo "Operation cancelled"
exit 0
fi

echo "Creating tag v$VERSION..."
git tag -a "v$VERSION" -m "zParse v$VERSION"
git push origin "v$VERSION"
Expand All @@ -88,7 +88,7 @@ delete_tag() {
echo "Operation cancelled"
exit 0
fi

echo "Deleting tag v$VERSION..."
git tag -d "v$VERSION" 2>/dev/null || echo "Tag v$VERSION not found locally"
git push --delete origin "v$VERSION" 2>/dev/null || echo "Tag v$VERSION not found on remote"
Expand Down
Loading