diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..ff952d2 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,75 @@ +name: Build ChangeTimestamp + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + build: + strategy: + matrix: + configuration: [Release] + + runs-on: windows-2019 + + steps: + - name: Checkout + uses: actions/checkout@main + with: + fetch-depth: 0 + + - name: Setup MSBuild + uses: microsoft/setup-msbuild@v1.0.2 + + - name: Install NuGet Packages + run: nuget restore ChangeTimestamp-CS.sln + + - name: Build solution for .NET Framework 3.5 + run: msbuild -nologo -v:m -p:Configuration=${{ matrix.configuration }} Client\Client35.csproj + + - name: Build solution for .NET Framework 4.0 + run: msbuild -nologo -v:m -p:Configuration=${{ matrix.configuration }} Client\Client40.csproj + + - name: Build solution for ChangeTimestamp project + run: msbuild -nologo -v:m -p:Configuration=${{ matrix.configuration }} ChangeTimestamp\ChangeTimestamp.csproj + + - name: Install 7Zip PowerShell Module + shell: powershell + run: Install-Module 7Zip4PowerShell -Force -Verbose + + - name: Build Artifact + shell: powershell + run: Compress-7Zip "Binaries\Release" -ArchiveFileName "ChangeTimestamp.zip" -Format Zip + + - name: Delete-tag-and-release + uses: dev-drprasad/delete-tag-and-release@v0.2.1 + with: + delete_release: true + tag_name: AutoBuild-Controler + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Create Release + id: create_release + uses: actions/create-release@latest + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: AutoBuild-Controler + release_name: AutoBuild-Controler + body: ${{ steps.changelog.outputs.changelog }} + draft: false + prerelease: true + + - name: Upload Release Asset + id: upload-release-asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./ChangeTimestamp.zip + asset_name: ChangeTimestamp.zip + asset_content_type: application/zip