Merge pull request #72 from mateuszskoczek/gitversion_config

Gitversion config
This commit is contained in:
2024-09-24 02:12:52 +02:00
committed by GitHub
Unverified
2 changed files with 31 additions and 1 deletions

11
.github/config/gitversion.yml vendored Normal file
View File

@@ -0,0 +1,11 @@
next-version: 0.1.0
assembly-versioning-scheme: MajorMinorPatch
assembly-file-versioning-scheme: MajorMinorPatch
branches:
master:
regex: ^master$
mode: ContinuousDelivery
increment: Patch
tag: ''
is-release-branch: true

View File

@@ -34,6 +34,16 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup GitVersion
uses: gittools/actions/gitversion/setup@v0.9.7
with:
versionSpec: 5.x
- name: Determine Version
uses: gittools/actions/gitversion/execute@v0.9.7
id: gitversion
with:
useConfigFile: true
configFilePath: .github/config/gitversion.yml
- name: App Settings Variable Substitution
uses: microsoft/variable-substitution@v1
if: ${{ matrix.app == 'WatchIt.WebAPI' }}
@@ -58,6 +68,15 @@ jobs:
with:
string: ${{ matrix.app }}
- name: Build image
run: docker build ${{ github.workspace }} -t ghcr.io/${{github.actor}}/${{ steps.name.outputs.lowercase }}:latest -f ${{ github.workspace }}/${{ matrix.app }}/${{ matrix.app }}/Dockerfile
run: docker build ${{ github.workspace }} -t ghcr.io/${{github.actor}}/${{ steps.name.outputs.lowercase }}:latest -t ghcr.io/${{github.actor}}/${{ steps.name.outputs.lowercase }}:{{steps.gitversion.outputs.SemVer}} -f ${{ github.workspace }}/${{ matrix.app }}/${{ matrix.app }}/Dockerfile
- name: Publish image
run: docker push ghcr.io/${{github.actor}}/${{ steps.name.outputs.lowercase }} --all-tags
- name: Create Release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{needs.build.outputs.version}}
release_name: ${{needs.build.outputs.version}}
draft: false
prerelease: false