Skip to content

Attempt to name release zip by version #19

Attempt to name release zip by version

Attempt to name release zip by version #19

Workflow file for this run

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
id: build
run: |
VERSION=$(sed -nr 's/^.*const string version.*"(.*)".*$/\1/pi' ./RockSniffer/Program.cs)
echo "Sniffer version: $VERSION"
echo "SNIFFER_VERSION=$VERSION" >> "$GITHUB_OUTPUT"
dotnet build --configuration Release --no-restore
- name: Publish
env:
SNIFFER_VERSION=${{ steps.build.outputs.SNIFFER_VERSION }}
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
(cd ./publish && zip -r "$OLDPWD/RockSniffer $SNIFFER_VERSION.zip" .)
- uses: actions/upload-artifact@v3
with:
name: RockSniffer-release
path: ./RockSniffer ${{ steps.build.outputs.SNIFFER_VERSION }}.zip