Add CI/build scripts, update Main and csproj #22
This file contains hidden or 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
| name: .NET | |
| permissions: | |
| contents: read | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| linux-build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@c2fa09f4bde5ebb9d1777cf28262a3eb3db3ced7 # v5.2.0 | |
| with: | |
| dotnet-version: 8.0.x | |
| - name: Restore dependencies | |
| run: cd src && dotnet restore AssemblyInfoUtils.sln | |
| - name: Build | |
| run: cd src && dotnet build AssemblyInfoUtils.sln --no-restore | |
| - name: Publish | |
| run: cd src && dotnet publish TownSuite.AssemblyInfoUtil.csproj -c Release -r linux-x64 -p:PublishReadyToRun=true --self-contained true -p:PublishSingleFile=true -p:EnableCompressionInSingleFile=true -f:net8.0 | |
| - name: Archive artifacts | |
| uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 | |
| with: | |
| name: linux-x64 | |
| path: | | |
| src/bin/Release/net8.0/linux-x64 | |
| retention-days: 1 | |
| windows-build: | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@c2fa09f4bde5ebb9d1777cf28262a3eb3db3ced7 # v5.2.0 | |
| with: | |
| dotnet-version: 8.0.x | |
| - name: Setup MSBuild | |
| uses: microsoft/setup-msbuild@30375c66a4eea26614e0d39710365f22f8b0af57 # v3.0.0 | |
| - name: Restore dependencies | |
| run: cd src && dotnet restore AssemblyInfoUtils.sln | |
| - name: Build | |
| run: cd src && dotnet build AssemblyInfoUtils.sln --no-restore | |
| - name: Publish net8.0 singlefile | |
| run: cd src && dotnet publish TownSuite.AssemblyInfoUtil.csproj -c Release -r win-x64 -p:PublishReadyToRun=true --self-contained true -p:PublishSingleFile=true -p:EnableCompressionInSingleFile=true -f:net8.0 | |
| - name: Archive artifacts | |
| uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 | |
| with: | |
| name: win-x64 | |
| path: | | |
| src/bin/Release | |
| retention-days: 1 | |
| mac-build: | |
| runs-on: macos-latest | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@c2fa09f4bde5ebb9d1777cf28262a3eb3db3ced7 # v5.2.0 | |
| with: | |
| dotnet-version: 8.0.x | |
| - name: Restore dependencies | |
| run: cd src && dotnet restore AssemblyInfoUtils.sln | |
| - name: Build | |
| run: cd src && dotnet build AssemblyInfoUtils.sln --no-restore | |
| - name: Publish | |
| run: cd src && dotnet publish TownSuite.AssemblyInfoUtil.csproj -c Release -r osx-x64 -p:PublishReadyToRun=true --self-contained true -p:PublishSingleFile=true -p:EnableCompressionInSingleFile=true -f:net8.0 | |
| - name: Archive artifacts | |
| uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0 | |
| with: | |
| name: osx-x64 | |
| path: | | |
| src/bin/Release/net8.0/osx-x64 | |
| retention-days: 1 |