Skip to content

Commit d0dda6a

Browse files
Set charm refresh compatibility version from git tag
1 parent 34634b5 commit d0dda6a

File tree

5 files changed

+72
-6
lines changed

5 files changed

+72
-6
lines changed

.github/workflows/release.yaml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,18 @@ on:
1313
- '.github/workflows/sync_docs.yaml'
1414

1515
jobs:
16+
tag:
17+
name: Create charm refresh compatibility version git tag
18+
uses: canonical/data-platform-workflows/.github/workflows/[email protected]
19+
with:
20+
track: 'dpe'
21+
permissions:
22+
contents: write # Needed to create git tag
23+
1624
ci-tests:
1725
name: Tests
26+
needs:
27+
- tag
1828
uses: ./.github/workflows/ci.yaml
1929
secrets: inherit
2030
permissions:
@@ -23,10 +33,11 @@ jobs:
2333
release:
2434
name: Release charm
2535
needs:
36+
- tag
2637
- ci-tests
2738
uses: canonical/data-platform-workflows/.github/workflows/[email protected]
2839
with:
29-
track: 'dpe'
40+
track: ${{ needs.tag.outputs.track }}
3041
artifact-prefix: ${{ needs.ci-tests.outputs.artifact-prefix }}
3142
secrets:
3243
charmhub-token: ${{ secrets.CHARMHUB_TOKEN }}

charmcraft.yaml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,18 @@ parts:
8383
files:
8484
plugin: dump
8585
source: .
86+
after:
87+
- poetry-deps # Ensure poetry is installed
8688
build-packages:
8789
- git
8890
override-build: |
89-
# TODO: set charm version in refresh_versions.toml
91+
# Set `charm_version` in refresh_versions.toml from git tag
92+
# Create venv in `..` so that git working tree is not dirty
93+
python3 -m venv ../refresh-version-venv
94+
source ../refresh-version-venv/bin/activate
95+
poetry install --only build-refresh-version
96+
write-charm-version
97+
9098
craftctl default
9199
stage:
92100
- LICENSE

poetry.lock

Lines changed: 45 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,12 @@ tenacity = "^9.0.0"
5656
ops = "^2.9.0"
5757
allure-pytest-default-results = "^0.1.2"
5858

59+
[tool.poetry.group.build-refresh-version]
60+
optional = true
61+
62+
[tool.poetry.group.build-refresh-version.dependencies]
63+
charm-refresh-build-version = "^0.2.0"
64+
5965
[tool.coverage.run]
6066
branch = true
6167

refresh_versions.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
charm_major = 1
22
workload = "8.0.41"
33

4-
charm = "8.0/1.0.0" # TODO remove
5-
64
[snap]
75
name = "charmed-mysql"
86

0 commit comments

Comments
 (0)