From dddd72a17287a0a04cebe13da5ff635f23c43343 Mon Sep 17 00:00:00 2001 From: Mateusz Skoczek Date: Tue, 24 Sep 2024 01:52:20 +0200 Subject: [PATCH 1/2] Create gitversion.yml --- .github/config/gitversion.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 .github/config/gitversion.yml diff --git a/.github/config/gitversion.yml b/.github/config/gitversion.yml new file mode 100644 index 0000000..6ab3dd4 --- /dev/null +++ b/.github/config/gitversion.yml @@ -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 From 1bd724ab86f278103bc509df6b283ae64cdc72ca Mon Sep 17 00:00:00 2001 From: Mateusz Skoczek Date: Tue, 24 Sep 2024 02:10:46 +0200 Subject: [PATCH 2/2] Update master_push.yml --- .github/workflows/master_push.yml | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/.github/workflows/master_push.yml b/.github/workflows/master_push.yml index 74606bb..e8436bd 100644 --- a/.github/workflows/master_push.yml +++ b/.github/workflows/master_push.yml @@ -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