Skip to content

Commit

Permalink
fix sed command bug for linux
Browse files Browse the repository at this point in the history
  • Loading branch information
CunliangGeng committed Jun 20, 2024
1 parent 87e60cd commit f552b33
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
7 changes: 0 additions & 7 deletions .github/workflows/publish_gh_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,6 @@ jobs:
if: ${{ inputs.current_version != inputs.new_version }}
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: '3.10'
- name: Upgrade pip and install dependencies
run: |
python3 -m pip install --upgrade pip
- name: Update package version and change log
run: |
make update-version CURRENT_VERSION=${{ inputs.current_version }} NEW_VERSION=${{ inputs.new_version }}
Expand Down
12 changes: 9 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,14 @@ endif
@echo "Updating version from $(CURRENT_VERSION) to $(NEW_VERSION) for following files:"
@for file in $(FILES); do \
echo " $$file"; \
sed -i '' -e 's/__version__ = "$(CURRENT_VERSION)"/__version__ = "$(NEW_VERSION)"/' $$file; \
sed -i '' -e 's/version = "$(CURRENT_VERSION)"/version = "$(NEW_VERSION)"/' $$file; \
sed -i '' -e 's/version: "$(CURRENT_VERSION)"/version: "$(NEW_VERSION)"/' $$file; \
if [ "$(shell uname)" = "Darwin" ]; then \
sed -i '' -e 's/__version__ = "$(CURRENT_VERSION)"/__version__ = "$(NEW_VERSION)"/' \
-e 's/version = "$(CURRENT_VERSION)"/version = "$(NEW_VERSION)"/' \
-e 's/version: "$(CURRENT_VERSION)"/version: "$(NEW_VERSION)"/' $$file; \
else \
sed -i'' -e 's/__version__ = "$(CURRENT_VERSION)"/__version__ = "$(NEW_VERSION)"/' \
-e 's/version = "$(CURRENT_VERSION)"/version = "$(NEW_VERSION)"/' \
-e 's/version: "$(CURRENT_VERSION)"/version: "$(NEW_VERSION)"/' $$file; \
fi; \
done
@echo "Version update complete."

0 comments on commit f552b33

Please sign in to comment.