From d31253f47e9ea467ac5f53d8bf8b1999c9b08c6c Mon Sep 17 00:00:00 2001 From: Marko Lahma Date: Thu, 15 Feb 2024 08:02:53 +0200 Subject: [PATCH] Improve build automation * fix workflow definitions * add minimal .gitattributes * convert line endings for build.sh * fix Acornima.sln --- .gitattributes | 14 ++++++++++++ .github/workflows/build.yml | 39 ++++++++++++++++++++++++++++----- .github/workflows/pr.yml | 1 + Acornima.sln | 8 ++++++- build/Build.CI.GitHubActions.cs | 10 ++++----- 5 files changed, 61 insertions(+), 11 deletions(-) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..4522003 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,14 @@ +# Auto detect text files and perform LF normalization +* text=auto + +# Custom for Visual Studio +*.cs diff=csharp +*.sln merge=union +*.csproj merge=union +*.vbproj merge=union +*.fsproj merge=union +*.dbproj merge=union + +# make sure *nix stays *nix +*.sh eol=lf + diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b1b8bd6..a3793c5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,13 +17,12 @@ name: build on: - pull_request: + push: branches: - main - paths: - - '**/*' - - workflow_dispatch: + - master + tags: + - 'v*.*.*' jobs: macos-latest: @@ -33,6 +32,16 @@ jobs: - uses: actions/checkout@v3 - name: 'Run: Compile, Test, Pack' run: ./build.cmd Compile Test Pack + - name: 'Publish: test-results' + uses: actions/upload-artifact@v3 + with: + name: test-results + path: artifacts/test-results + - name: 'Publish: packages' + uses: actions/upload-artifact@v3 + with: + name: packages + path: artifacts/packages ubuntu-latest: name: ubuntu-latest runs-on: ubuntu-latest @@ -40,6 +49,16 @@ jobs: - uses: actions/checkout@v3 - name: 'Run: Compile, Test, Pack' run: ./build.cmd Compile Test Pack + - name: 'Publish: test-results' + uses: actions/upload-artifact@v3 + with: + name: test-results + path: artifacts/test-results + - name: 'Publish: packages' + uses: actions/upload-artifact@v3 + with: + name: packages + path: artifacts/packages windows-latest: name: windows-latest runs-on: windows-latest @@ -47,3 +66,13 @@ jobs: - uses: actions/checkout@v3 - name: 'Run: Compile, Test, Pack' run: ./build.cmd Compile Test Pack + - name: 'Publish: test-results' + uses: actions/upload-artifact@v3 + with: + name: test-results + path: artifacts/test-results + - name: 'Publish: packages' + uses: actions/upload-artifact@v3 + with: + name: packages + path: artifacts/packages diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 743a710..a3fa9bf 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -20,6 +20,7 @@ on: pull_request: branches: - main + - master paths: - '**/*' diff --git a/Acornima.sln b/Acornima.sln index 45b491f..561aba4 100644 --- a/Acornima.sln +++ b/Acornima.sln @@ -26,7 +26,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Acornima.Tests", "test\Acor EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Acornima.Tests.Test262", "test\Acornima.Tests.Test262\Acornima.Tests.Test262.csproj", "{A7CA9D3E-5247-4212-9E08-BDECBC63B8E1}" EndProject -lobal +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Acornima.Extras", "src\Acornima.Extras\Acornima.Extras.csproj", "{52853C1D-4BC3-4A82-B7C9-FDC2162689DA}" +EndProject +Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU Release|Any CPU = Release|Any CPU @@ -62,6 +64,10 @@ lobal {F2B479F2-5104-4ACB-BC8A-92422C9F3736}.Debug|Any CPU.Build.0 = Debug|Any CPU {F2B479F2-5104-4ACB-BC8A-92422C9F3736}.Release|Any CPU.ActiveCfg = Release|Any CPU {F2B479F2-5104-4ACB-BC8A-92422C9F3736}.Release|Any CPU.Build.0 = Release|Any CPU + {52853C1D-4BC3-4A82-B7C9-FDC2162689DA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {52853C1D-4BC3-4A82-B7C9-FDC2162689DA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {52853C1D-4BC3-4A82-B7C9-FDC2162689DA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {52853C1D-4BC3-4A82-B7C9-FDC2162689DA}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/build/Build.CI.GitHubActions.cs b/build/Build.CI.GitHubActions.cs index ce2dad2..cf2ae17 100644 --- a/build/Build.CI.GitHubActions.cs +++ b/build/Build.CI.GitHubActions.cs @@ -6,7 +6,7 @@ GitHubActionsImage.MacOsLatest, GitHubActionsImage.UbuntuLatest, GitHubActionsImage.WindowsLatest, - OnPullRequestBranches = ["main"], + OnPullRequestBranches = ["main", "master"], OnPullRequestIncludePaths = ["**/*"], PublishArtifacts = false, InvokedTargets = [nameof(ICompile.Compile), nameof(ITest.Test), nameof(IPack.Pack)], @@ -18,11 +18,11 @@ GitHubActionsImage.MacOsLatest, GitHubActionsImage.UbuntuLatest, GitHubActionsImage.WindowsLatest, - OnPullRequestBranches = ["main"], - OnPullRequestIncludePaths = ["**/*"], - PublishArtifacts = false, + OnPushBranches = ["main", "master"], + OnPushTags = ["v*.*.*"], + PublishArtifacts = true, InvokedTargets = [nameof(ICompile.Compile), nameof(ITest.Test), nameof(IPack.Pack)], CacheKeyFiles = [] ) ] -public partial class Build; \ No newline at end of file +public partial class Build;