From 216eddbca6e565bf437784fc1d18b435259d7131 Mon Sep 17 00:00:00 2001 From: gdlcf88 Date: Thu, 16 Jul 2020 18:55:27 +0800 Subject: [PATCH] Automatically add git tag --- .github/workflows/publish.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 93e250b6..c8091f9d 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -15,11 +15,32 @@ jobs: - name: dotnet pack run: dotnet pack -c Release --no-build -o dest + + - name: read common.props + id: commonProps + uses: juliangruber/read-file-action@v1 + with: + path: ./common.props + + - name: get version + id: getVersion + uses: AsasInnab/regex-action@v1 + with: + regex_pattern: '^\s*(.*)<\/Version>\s*$' + regex_flags: 'gim' + search_string: '${{ steps.commonProps.outputs.content }}' + + - name: add git tag + uses: Klemensas/action-autotag@stable + with: + version: ${{ steps.commonProps.outputs.content }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: remove unused packages run: | cd dest del * -Exclude EasyAbp.* + del * -Exclude *.${{ steps.commonProps.outputs.content }}.nupkg del *.HttpApi.Client.ConsoleTestApp* del *.Host.Shared* dir -name