diff --git a/.github/workflows/ci-cd.yaml b/.github/workflows/ci-cd.yaml index c811eabe..768c56a9 100644 --- a/.github/workflows/ci-cd.yaml +++ b/.github/workflows/ci-cd.yaml @@ -102,6 +102,21 @@ jobs: dotnet coverage collect "dotnet test src/WHMapper.Tests -c Release" -f xml -o "coverage.xml" dotnet sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}" + - name: Install GitVersion + if: github.event_name != 'pull_request' + run: dotnet tool install --global GitVersion.Tool + + - name: Generate version + if: github.event_name != 'pull_request' + run: gitversion /output json /showvariable FullSemVer + id: gitversion + + - name: Update .csproj version + if: github.event_name != 'pull_request' + run: | + VERSION=${{ steps.gitversion.outputs.FullSemVer }} + sed -i "s/.*<\/Version>/$VERSION<\/Version>/" src/WHMapper/WHMapper.csproj + - name: Generate Artifact if: github.event_name != 'pull_request' run: | @@ -171,7 +186,7 @@ jobs: org.opencontainers.image.authors=${{ github.actor }} tags: | type=edge,branch=$repo.default_branch - type=semver,pattern=v{{version}} + type=semver,pattern={{version}} type=sha,prefix=,suffix=,format=short - name: Authenticate to registry ${{ env.REGISTRY_DOCKERHUB }} diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index 14b6152f..6eb16202 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -31,12 +31,16 @@ jobs: # Disabling shallow clone is recommended for improving relevancy of reporting fetch-depth: 0 + - name: Extract version from tag + id: extract_version + run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV + - name: 📦 Generate Package (linux x64/arm, Windows x64) run: | dotnet restore src - dotnet publish src/WHMapper/WHMapper.csproj -c Release -r linux-x64 --nologo --output ./release/linux-x64 - dotnet publish src/WHMapper/WHMapper.csproj -c Release -r linux-arm --nologo --output ./release/linux-arm - dotnet publish src/WHMapper/WHMapper.csproj -c Release -r win-x64 --nologo --output ./release/win-x64 + dotnet publish src/WHMapper/WHMapper.csproj -c Release -r linux-x64 --nologo --output ./release/linux-x64 /p:Version=${{ env.VERSION }} + dotnet publish src/WHMapper/WHMapper.csproj -c Release -r linux-arm --nologo --output ./release/linux-arm /p:Version=${{ env.VERSION }} + dotnet publish src/WHMapper/WHMapper.csproj -c Release -r win-x64 --nologo --output ./release/win-x64 /p:Version=${{ env.VERSION }} zip -r WHMapper.linux-x64.zip ./release/linux-x64 -j zip -r WHMapper.linux-arm.zip ./release/linux-arm -j diff --git a/deploy/docker/eve-whmapper/docker-compose.yml b/deploy/docker/eve-whmapper/docker-compose.yml index 0bcfc833..10884bb9 100644 --- a/deploy/docker/eve-whmapper/docker-compose.yml +++ b/deploy/docker/eve-whmapper/docker-compose.yml @@ -21,7 +21,7 @@ services: - net whmapper: - image: ghcr.io/pfh59/eve-whmapper:latest + image: ghcr.io/pfh59/eve-whmapper:1.1 restart: unless-stopped environment: - EveSSO__ClientId=xxxxxxxxx diff --git a/deploy/kubernetes/deploys/frontend.yaml b/deploy/kubernetes/deploys/frontend.yaml index 23fc6ee6..2e11e844 100644 --- a/deploy/kubernetes/deploys/frontend.yaml +++ b/deploy/kubernetes/deploys/frontend.yaml @@ -17,7 +17,7 @@ spec: spec: containers: - name: evemapper-app - image: ghcr.io/pfh59/eve-whmapper:latest + image: ghcr.io/pfh59/eve-whmapper:1.1 envFrom: - configMapRef: name: evemapper-config-map diff --git a/src/WHMapper.Tests/WHMapper.Tests.csproj b/src/WHMapper.Tests/WHMapper.Tests.csproj index d990cbdd..530bd3ae 100644 --- a/src/WHMapper.Tests/WHMapper.Tests.csproj +++ b/src/WHMapper.Tests/WHMapper.Tests.csproj @@ -12,21 +12,21 @@ - + - - + + runtime; build; native; contentfiles; analyzers; buildtransitive all - + runtime; build; native; contentfiles; analyzers; buildtransitive all - - + + diff --git a/src/WHMapper/Shared/MainLayout.razor b/src/WHMapper/Shared/MainLayout.razor index 75ed2582..b11102ec 100644 --- a/src/WHMapper/Shared/MainLayout.razor +++ b/src/WHMapper/Shared/MainLayout.razor @@ -31,7 +31,8 @@ { - Wormhole Mapper + Wormhole Mapper + @String.Format("v{0}", Version) @@ -55,6 +56,7 @@ private MudTheme _currentTheme = null!; private bool _loading = true; private string _init_process_msg = string.Empty; + private string Version { get; set; } = string.Empty; [Inject] private ISnackbar Snackbar {get;set;} =null!; @@ -90,10 +92,12 @@ Primary = "#ffffff", PrimaryDarken = "#ffffff", PrimaryLighten = "#ffffff" - } }; + var version = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version; + Version = version != null ? version.ToString(3) : "Unknown"; + if(SDEServices.IsExtractionSuccesful()) { _loading = false; diff --git a/src/WHMapper/WHMapper.csproj b/src/WHMapper/WHMapper.csproj index e57dd0a7..7f0a4847 100644 --- a/src/WHMapper/WHMapper.csproj +++ b/src/WHMapper/WHMapper.csproj @@ -6,6 +6,7 @@ enable ../docker-compose.dcproj 6545e3a1-0941-41bf-a51b-1a58ca6ed175 + 0.0.0 @@ -76,27 +77,27 @@ - - + + - - + + - - - - + + + + runtime; build; native; contentfiles; analyzers; buildtransitive all - - - - - + + + + +