diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8eb42ed3f..1b9f8dc5c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -43,6 +43,15 @@ jobs: - name: Checkout uses: actions/checkout@v3 + - name: Add git hash to version + if: github.ref == 'refs/heads/master' + run: | + current_version=$(grep -m 1 -oP 'version = "\K[^"]+' pyproject.toml) + latest_commit_hash=$(git rev-parse --short HEAD) + new_version="${current_version}+${latest_commit_hash}" + sed -i 's/version = \"${current_version}\"/version = \"${new_version}\"/' pyproject.toml + echo "Set project to version ${new_version}" + - name: Set up Docker Buildx uses: docker/setup-buildx-action@v2 @@ -163,6 +172,15 @@ jobs: - name: Checkout uses: actions/checkout@v3 + - name: Add git hash to version + if: github.ref == 'refs/heads/master' + run: | + current_version=$(grep -m 1 -oP 'version = "\K[^"]+' pyproject.toml) + latest_commit_hash=$(git rev-parse --short HEAD) + new_version="${current_version}+${latest_commit_hash}" + sed -i 's/version = \"${current_version}\"/version = \"${new_version}\"/' pyproject.toml + echo "Set project to version ${new_version}" + - name: Set up QEMU uses: docker/setup-qemu-action@v2 @@ -195,6 +213,15 @@ jobs: - name: Checkout uses: actions/checkout@v3 + - name: Add git hash to version + if: github.ref == 'refs/heads/master' + run: | + current_version=$(grep -m 1 -oP 'version = "\K[^"]+' pyproject.toml) + latest_commit_hash=$(git rev-parse --short HEAD) + new_version="${current_version}+${latest_commit_hash}" + sed -i 's/version = \"${current_version}\"/version = \"${new_version}\"/' pyproject.toml + echo "Set project to version ${new_version}" + - name: Set up QEMU uses: docker/setup-qemu-action@v2 @@ -227,6 +254,15 @@ jobs: - name: Checkout uses: actions/checkout@v3 + - name: Add git hash to version + if: github.ref == 'refs/heads/master' + run: | + current_version=$(grep -m 1 -oP 'version = "\K[^"]+' pyproject.toml) + latest_commit_hash=$(git rev-parse --short HEAD) + new_version="${current_version}+${latest_commit_hash}" + sed -i 's/version = \"${current_version}\"/version = \"${new_version}\"/' pyproject.toml + echo "Set project to version ${new_version}" + - name: Set up QEMU uses: docker/setup-qemu-action@v2