diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 5c121c1..4403989 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -29,6 +29,10 @@ jobs: tags: | type=semver,pattern={{version}} + - name: Set application version + if: ${{ github.ref_type == 'tag' }} + run: sed -i 's/^version = ".*"$/version = "${{ steps.meta.outputs.version }}"/' Cargo.toml + - name: Build image uses: docker/build-push-action@v6 env: diff --git a/Cargo.lock b/Cargo.lock index c328197..5d249e6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1901,7 +1901,7 @@ dependencies = [ [[package]] name = "numtracker" -version = "0.1.1" +version = "0.0.0" dependencies = [ "assert_matches", "async-graphql", diff --git a/Cargo.toml b/Cargo.toml index 74f9f84..3355f25 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,8 @@ [package] name = "numtracker" -version = "0.1.1" +# This version is *not* used for the built container image. It is set during the +# CI build process so that the version always matches the latest git tag. +version = "0.0.0" edition = "2021" license = "Apache-2.0" diff --git a/helm/numtracker/Chart.yaml b/helm/numtracker/Chart.yaml index 291ad0c..c8c2965 100644 --- a/helm/numtracker/Chart.yaml +++ b/helm/numtracker/Chart.yaml @@ -1,24 +1,11 @@ apiVersion: v2 name: numtracker description: Helm chart to deploy the numtracker service for unifying beamline filenaming - -# A chart can be either an 'application' or a 'library' chart. -# -# Application charts are a collection of templates that can be packaged into versioned archives -# to be deployed. -# -# Library charts provide useful utilities or functions for the chart developer. They're included as -# a dependency of application charts to inject those utilities and functions into the rendering -# pipeline. Library charts do not define any templates and therefore cannot be deployed. type: application -# This is the chart version. This version number should be incremented each time you make changes -# to the chart and its templates, including the app version. -# Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.1.0 +# These versions are ignored and are automatically set via the CI process to the version from the tag -# This is the version number of the application being deployed. This version number should be -# incremented each time you make changes to the application. Versions are not expected to -# follow Semantic Versioning. They should reflect the version the application is using. -# It is recommended to use it with quotes. -appVersion: "0.1.0" +# This is the version of the helm chart +version: 0.0.0 +# This is the version number of the application being deployed by the helm chart +appVersion: "0.0.0"