From 489a5da8e4b99817547267ac3ce2eaee8138f4d7 Mon Sep 17 00:00:00 2001 From: Ionite Date: Sun, 25 Jun 2023 18:22:44 -0400 Subject: [PATCH] Add actions build CI for new tags --- .github/workflows/release.yml | 45 +++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..7aa8fad8 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,45 @@ +name: Release + +on: + push: + tags: + - '*' + branches: [ main ] + +jobs: + release: + if: github.repository == 'ionite34/StabilityMatrix' + runs-on: windows-latest + + steps: + - uses: actions/checkout@v3 + + - name: Set Tag + run: | + VERSION=${GITHUB_REF#refs/*/} + VERSION=${VERSION#v} + VERSION=${VERSION}.0 + echo "RELEASE_VERSION=$VERSION" >> $GITHUB_ENV + + - name: Remove old artifacts + uses: c-hive/gha-remove-artifacts@v1 + with: + age: '90 seconds' + skip-tags: false + + - name: Set up .NET + uses: actions/setup-dotnet@v3 + with: + dotnet-version: '6.0.x' + + - name: Install dependencies + run: dotnet restore -p:PublishReadyToRun=true + + - name: Build + run: dotnet publish ./StabilityMatrix/StabilityMatrix.csproj -o out -c Release -r win-x64 -p:Version=${RELEASE_VERSION} -p:PublishReadyToRun=true -p:PublishSingleFile=true --self-contained true + + - name: Upload Artifact + uses: actions/upload-artifact@v2 + with: + name: StabilityMatrix + path: ./out/StabilityMatrix.exe