diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index a30e138..ba0197f 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -4,10 +4,12 @@ on: push: tags: - 'v*.*.*' # Triggers on version tags + branches: + - '**' # Triggers on all branches jobs: build: - runs-on: windows-latest + runs-on: ubuntu-latest # Use a single runner steps: - name: Checkout code @@ -18,21 +20,25 @@ jobs: with: dotnet-version: '8.0' - - name: Restore dependencies - run: dotnet restore + - name: Git Version + id: version + uses: codacy/git-version@2.5.4 - name: Build - run: dotnet build --configuration Release --no-restore - - - name: Publish - run: dotnet publish --configuration Release --no-build --output ./output - - - name: Zip Files - run: Compress-Archive -Path ./output/* mgsscripttools.zip + run: | + dotnet publish --configuration Release --runtime win-x64 --no-self-contained --output publish/magesscripttool-windows-amd64 src/MagesScriptTool + cd ./output/windows + zip -r ../../magesscripttool-windows-amd64.zip ./* + cd ../linux + zip -r ../../magesscripttool-linux-amd64.zip ./* + cd ../.. - name: Create GitHub Release uses: softprops/action-gh-release@v1 with: - files: mgsscripttools.zip + files: | + magesscripttool-linux-amd64.zip + magesscripttool-windows-amd64.zip + tag_name: ${{ steps.version.outputs.version }} env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}