mirror of
https://github.com/unclshura/splitter.git
synced 2026-06-21 16:12: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:
|
||||
push:
|
||||
branches: [ "master" ]
|
||||
pull_request:
|
||||
branches: [ "master" ]
|
||||
tags:
|
||||
- 'v*'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
@ -22,18 +21,22 @@ jobs:
|
||||
- name: Restore
|
||||
run: dotnet restore -r win-x64
|
||||
|
||||
- name: 'Get Version'
|
||||
id: version
|
||||
uses: battila7/get-version-action@v2
|
||||
|
||||
- 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
|
||||
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
|
||||
shell: pwsh
|
||||
run: |
|
||||
$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"
|
||||
|
||||
if (Test-Path $zip) { Remove-Item $zip }
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user