diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4a32403ffd..44b656d6a3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -131,6 +131,17 @@ jobs: if: github.event_name == 'pull_request' steps: - uses: actions/checkout@v4 + - name: Get short commit SHA + id: short-sha + run: echo "sha=$(git rev-parse --short $GITHUB_SHA)" >> $GITHUB_OUTPUT + - name: Get current version (MAJOR.MINOR.PATCH) + id: current-version + run: echo "current_version=$(grep -Po "[\d.]+" rdmo/__init__.py)" >> $GITHUB_OUTPUT + - name: Add SHA as suffix to version + run: | + NEW_VERSION="${{ steps.current-version.outputs.current_version }}.dev0+${{ steps.short-sha.outputs.sha }}" + sed -i "s/__version__ = .*/__version__ = \"$NEW_VERSION\"/" rdmo/__init__.py + - run: cat rdmo/__init__.py - uses: actions/setup-node@v4 with: node-version: 18 @@ -143,11 +154,6 @@ jobs: cache: pip - run: python -m pip install --upgrade build pip setuptools wheel - run: python -m build --wheel - - run: | - PR_NUMBER=${{ github.event.pull_request.number }} - WHL_FILE=$(ls dist/*.whl) - NEW_NAME="${WHL_FILE/-py3-none-any/dev${PR_NUMBER}-py3-none-any}" - mv "$WHL_FILE" "$NEW_NAME" - uses: actions/upload-artifact@v3 with: name: wheel