Add git hash to version for master builds
This commit is contained in:
36
.github/workflows/ci.yml
vendored
36
.github/workflows/ci.yml
vendored
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user