Get sniffer version from Program.cs #17
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: [push, pull_request] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: 'recursive' | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: 6.0.x | |
- name: Restore dependencies | |
run: dotnet restore | |
- name: Build | |
run: | | |
echo "SNIFFER_VERSION=$(sed -nr 's/^.*const string version.*"(.*)".*$/\1/pi' ./RockSniffer/Program.cs)" >> "$GITHUB_ENV" | |
echo "Sniffer version: $SNIFFER_VERSION" | |
dotnet build --configuration Release --no-restore | |
- name: Publish | |
run: | | |
dotnet publish RockSniffer -c Release -o ./publish --runtime win-x64 --framework=net6.0-windows --self-contained false -p:PublishSingleFile=true | |
cp -r ./addons ./publish/addons | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: publish | |
path: ./publish |