From f60fb6ee26c176bc6cab504132bbb7cde1123358 Mon Sep 17 00:00:00 2001 From: Xevion Date: Tue, 26 Nov 2024 15:45:11 -0600 Subject: [PATCH] Add build action --- .github/workflows/build.yaml | 42 ++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .github/workflows/build.yaml diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 0000000..d01464c --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,42 @@ +name: Build + +env: + SLN_PATH: factorio-achievements-fixer/ + +on: + workflow_dispatch: + push: + paths-ignore: + - "README.md" + - "LICENSE" + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + + - name: Setup Dotnet + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 8.0.x + + - name: Install Application Dependencies + run: dotnet restore ${{ env.SLN_PATH }} + + - name: Build Application + run: dotnet build ${{ env.SLN_PATH }} --configuration Release --no-restore + + - name: Extract Version + id: extract_version + run: | + version=$(grep -oP '(?<=\[assembly: AssemblyVersion\(")[^"]+' ${{ env.SLN_PATH }}/AssemblyInfo.cs) + echo "VERSION=$version" >> $GITHUB_ENV + + - name: Upload Artifact + uses: actions/upload-artifact@v4 + with: + name: factorio-achievements-fixer-$VERSION + path: