From e432040321006cacf242fb7430aa017600093313 Mon Sep 17 00:00:00 2001 From: Tom Date: Wed, 19 Feb 2025 17:00:57 +0000 Subject: [PATCH] swtich from cargo edit to sed --- .github/workflows/build_wheels.yml | 22 +++++++--------------- .github/workflows/update_version.sh | 2 ++ 2 files changed, 9 insertions(+), 15 deletions(-) create mode 100755 .github/workflows/update_version.sh diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index 996e047..b9ce0df 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -36,9 +36,7 @@ jobs: with: python-version: 3.x - name: Set cargo version from tag - run: | - cargo install cargo-edit - cargo set-version $(git describe --tags --always) + run: .github/workflows/update_version.sh - name: Build wheels uses: PyO3/maturin-action@v1 @@ -72,9 +70,8 @@ jobs: with: python-version: 3.x - name: Set cargo version from tag - run: | - cargo install cargo-edit - cargo set-version $(git describe --tags --always) + run: .github/workflows/update_version.sh + - name: Build wheels uses: PyO3/maturin-action@v1 with: @@ -104,9 +101,8 @@ jobs: python-version: 3.x architecture: ${{ matrix.platform.target }} - name: Set cargo version from tag - run: | - cargo install cargo-edit - cargo set-version $(git describe --tags --always) + run: .github/workflows/update_version.sh + - name: Build wheels uses: PyO3/maturin-action@v1 with: @@ -134,9 +130,7 @@ jobs: with: python-version: 3.x - name: Set cargo version from tag - run: | - cargo install cargo-edit - cargo set-version $(git describe --tags --always) + run: .github/workflows/update_version.sh - name: Build wheels uses: PyO3/maturin-action@v1 with: @@ -154,9 +148,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: Set cargo version from tag - run: | - cargo install cargo-edit - cargo set-version $(git describe --tags --always) + run: .github/workflows/update_version.sh - name: Build sdist uses: PyO3/maturin-action@v1 with: diff --git a/.github/workflows/update_version.sh b/.github/workflows/update_version.sh new file mode 100755 index 0000000..65b7f9d --- /dev/null +++ b/.github/workflows/update_version.sh @@ -0,0 +1,2 @@ +VERSION=$(git describe --tags --always | sed 's/^v//') +sed -i -E 's/^version = "[^"]+"/version = "'"$VERSION"'"/' Cargo.toml \ No newline at end of file