mirror of
https://github.com/unclshura/splitter.git
synced 2026-06-22 00:22:01 +00:00
Get version from the release tag
This commit is contained in:
parent
80a346583d
commit
d46dda1271
15
.github/workflows/publish.yml
vendored
15
.github/workflows/publish.yml
vendored
@ -2,9 +2,8 @@ name: Build and Publish
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ "master" ]
|
tags:
|
||||||
pull_request:
|
- 'v*'
|
||||||
branches: [ "master" ]
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
@ -22,18 +21,22 @@ jobs:
|
|||||||
- name: Restore
|
- name: Restore
|
||||||
run: dotnet restore -r win-x64
|
run: dotnet restore -r win-x64
|
||||||
|
|
||||||
|
- name: 'Get Version'
|
||||||
|
id: version
|
||||||
|
uses: battila7/get-version-action@v2
|
||||||
|
|
||||||
- name: Build Release
|
- name: Build Release
|
||||||
run: dotnet build -c Release --no-restore /p:BuildNumber=${{ github.run_number }} /p:SourceRevisionId=${{ github.sha }}
|
run: dotnet build -c Release --no-restore -r win-x64 /p:Version=${{ steps.version.outputs.version-without-v }} /p:BuildNumber=${{ github.run_number }} /p:SourceRevisionId=${{ github.sha }}
|
||||||
|
|
||||||
- name: Publish Release
|
- name: Publish Release
|
||||||
run: dotnet publish -c Release -r win-x64 --self-contained true --no-build /p:BuildNumber=${{ github.run_number }} /p:SourceRevisionId=${{ github.sha }}
|
run: dotnet publish -c Release -r win-x64 --self-contained true --no-build /p:Version=${{ steps.version.outputs.version-without-v }} /p:BuildNumber=${{ github.run_number }} /p:SourceRevisionId=${{ github.sha }}
|
||||||
|
|
||||||
|
|
||||||
- name: Create ZIP
|
- name: Create ZIP
|
||||||
shell: pwsh
|
shell: pwsh
|
||||||
run: |
|
run: |
|
||||||
$publish = "bin/Release/net10.0/win-x64/publish"
|
$publish = "bin/Release/net10.0/win-x64/publish"
|
||||||
$version = (Select-String -Path "$publish\*.deps.json" -Pattern '"version":').Line.Split('"')[3]
|
$version = ${{ steps.version.outputs.version-without-v }}
|
||||||
$zip = "splitter-win-x64-$version-${{ github.run_number }}.zip"
|
$zip = "splitter-win-x64-$version-${{ github.run_number }}.zip"
|
||||||
|
|
||||||
if (Test-Path $zip) { Remove-Item $zip }
|
if (Test-Path $zip) { Remove-Item $zip }
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user