|
1 | 1 | name: .NET Core - Release |
2 | 2 |
|
3 | 3 | on: |
4 | | - push: |
5 | | - branches: [ new-analysis, development ] |
6 | | - pull_request: |
7 | | - branches: [ new-analysis, development ] |
8 | | - workflow_dispatch: |
| 4 | + push: |
| 5 | + branches: [ new-analysis, development ] |
| 6 | + pull_request: |
| 7 | + branches: [ new-analysis, development ] |
| 8 | + workflow_dispatch: |
9 | 9 |
|
10 | 10 | jobs: |
11 | | - release-net9: |
12 | | - strategy: |
13 | | - matrix: |
14 | | - runtimeIdentifier: [linux-x64, linux-arm64, osx-x64, osx-arm64, win-x64, win-arm64] |
15 | | - project: [Cpp2IL] |
16 | | - name: Build Single-File Artifact |
17 | | - runs-on: ubuntu-latest |
18 | | - steps: |
19 | | - - uses: actions/checkout@v4 |
20 | | - - uses: actions/setup-dotnet@v4.1.0 |
21 | | - with: |
22 | | - dotnet-version: 9.x |
23 | | - - id: git-vars |
24 | | - name: Get git branch information |
25 | | - shell: bash |
26 | | - run: | |
27 | | - echo "##[set-output name=git_branch;]$(echo $GITHUB_REF)" |
28 | | - echo "::set-output name=git_hash::$(git rev-parse --short HEAD)" |
29 | | - - id: set-vars |
30 | | - uses: actions/github-script@v7 |
31 | | - with: |
32 | | - script: | |
33 | | - core.setOutput("extension", "${{ matrix.runtimeIdentifier }}" === "win-x64" ? ".exe" : ""); |
34 | | -
|
35 | | - let gitHash = "${{ steps.git-vars.outputs.git_hash }}"; |
36 | | - let runNumber = "${{ github.run_number }}"; |
37 | | - let rawGitRef = "${{ steps.git-vars.outputs.git_branch }}"; |
38 | | - console.log("rawGitRef: " + rawGitRef); |
39 | | - let gitRef = rawGitRef.replace(/^refs\/heads\//, ""); |
40 | | - if(gitRef.indexOf("refs/pull/") === 0) { |
41 | | - gitRef = "pr-" + gitRef.substring(10, gitRef.lastIndexOf("/")); |
42 | | - } |
43 | | - var versString = `${gitRef}.${runNumber}+${gitHash}`; |
44 | | - console.log(versString); |
45 | | - core.setOutput("versionString", versString); |
46 | | - - name: Restore |
47 | | - run: dotnet restore -r ${{ matrix.runtimeIdentifier }} /p:VersionSuffix=${{ steps.set-vars.outputs.versionString }} |
48 | | - - name: Build |
49 | | - working-directory: ./${{ matrix.project }}/ |
50 | | - run: dotnet publish -c Release -f net9.0 -r ${{ matrix.runtimeIdentifier }} /p:VersionSuffix=${{ steps.set-vars.outputs.versionString }} --no-restore --self-contained |
51 | | - - name: Upload Executable |
52 | | - uses: actions/upload-artifact@v4 |
53 | | - with: |
54 | | - name: ${{ matrix.project }}-net9-${{ matrix.runtimeIdentifier }} |
55 | | - path: ./${{ matrix.project }}/bin/Release/net9.0/${{ matrix.runtimeIdentifier }}/publish/${{ matrix.project }}${{ steps.set-vars.outputs.extension }} |
56 | | - release-netframework: |
57 | | - name: Build - Windows .NET Framework Zip |
58 | | - runs-on: ubuntu-latest |
59 | | - steps: |
60 | | - - uses: actions/checkout@v4 |
61 | | - - uses: actions/setup-dotnet@v4.1.0 |
62 | | - with: |
63 | | - dotnet-version: 9.x |
64 | | - - name: Install dependencies |
65 | | - run: dotnet restore -r win-x64 |
66 | | - - name: Build |
67 | | - working-directory: ./Cpp2IL/ |
68 | | - run: dotnet publish -c Release -f net472 --no-restore -r win-x64 |
69 | | - - name: Upload |
70 | | - uses: actions/upload-artifact@v4 |
71 | | - with: |
72 | | - name: Cpp2IL-Netframework472-Windows |
73 | | - path: ./Cpp2IL/bin/Release/net472/win-x64/publish/ |
74 | | - tests: |
75 | | - name: Run Tests & Publish Dev Package |
76 | | - runs-on: ubuntu-latest |
77 | | - if: github.repository == 'SamboyCoding/Cpp2IL' |
78 | | - steps: |
79 | | - - uses: actions/checkout@v4 |
80 | | - - uses: actions/setup-dotnet@v4.1.0 |
81 | | - with: |
82 | | - dotnet-version: 9.x |
83 | | - - id: git-vars |
84 | | - name: Set up environment |
85 | | - shell: bash |
86 | | - run: | |
87 | | - echo "##[set-output name=git_branch;]$(echo $GITHUB_REF)" |
88 | | - echo "::set-output name=git_hash::$(git rev-parse --short HEAD)" |
89 | | - - id: set-vars |
90 | | - uses: actions/github-script@v7 |
91 | | - with: |
92 | | - script: | |
93 | | - let gitHash = "${{ steps.git-vars.outputs.git_hash }}"; |
94 | | - let runNumber = "${{ github.run_number }}"; |
95 | | - let rawGitRef = "${{ steps.git-vars.outputs.git_branch }}"; |
96 | | - console.log("rawGitRef: " + rawGitRef); |
97 | | - let gitRef = rawGitRef.replace(/^refs\/heads\//, ""); |
98 | | - if(gitRef.indexOf("refs/pull/") === 0) { |
99 | | - gitRef = "pr-" + gitRef.substring(10, gitRef.lastIndexOf("/")); |
100 | | - } |
101 | | - var versString = `${gitRef}.${runNumber}+${gitHash}`; |
102 | | - console.log(versString); |
103 | | - core.setOutput("versionString", versString); |
104 | | - - name: Install dependencies |
105 | | - run: dotnet restore /p:VersionSuffix=${{ steps.set-vars.outputs.versionString }} |
106 | | - - name: Build all |
107 | | - run: dotnet build -c Release /p:VersionSuffix=${{ steps.set-vars.outputs.versionString }} |
108 | | - - name: Run Tests |
109 | | - run: dotnet test -c Release /p:VersionSuffix=${{ steps.set-vars.outputs.versionString }} --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=lcov /p:CoverletOutput='./lcov.info' /p:ExcludeByAttribute="LibCpp2IL.Coverage.NoCoverageAttribute" |
110 | | - - name: Upload Coverage |
111 | | - uses: coverallsapp/github-action@v2.3.4 |
112 | | - with: |
113 | | - github-token: ${{ secrets.GITHUB_TOKEN }} |
114 | | - files: ./Cpp2IL.Core.Tests/lcov.info ./LibCpp2ILTests/lcov.info |
115 | | - - name: Publish StableNameDotNet |
116 | | - if: github.event_name == 'push' |
117 | | - run: dotnet nuget push -s https://nuget.samboy.dev/v3/index.json -k ${{ secrets.NUGET_KEY }} ./StableNameDotNet/bin/Release/*.nupkg |
118 | | - - name: Publish WasmDisassembler |
119 | | - if: github.event_name == 'push' |
120 | | - run: dotnet nuget push -s https://nuget.samboy.dev/v3/index.json -k ${{ secrets.NUGET_KEY }} ./WasmDisassembler/bin/Release/*.nupkg |
121 | | - - name: Publish LibCpp2IL |
122 | | - if: github.event_name == 'push' |
123 | | - run: dotnet nuget push -s https://nuget.samboy.dev/v3/index.json -k ${{ secrets.NUGET_KEY }} ./LibCpp2IL/bin/Release/*.nupkg |
124 | | - - name: Publish Cpp2IL.Core |
125 | | - if: github.event_name == 'push' |
126 | | - run: dotnet nuget push -s https://nuget.samboy.dev/v3/index.json -k ${{ secrets.NUGET_KEY }} ./Cpp2IL.Core/bin/Release/*.nupkg |
127 | | - - name: Publish Cpp2IL.Plugin.BuildReport |
128 | | - if: github.event_name == 'push' |
129 | | - run: dotnet nuget push -s https://nuget.samboy.dev/v3/index.json -k ${{ secrets.NUGET_KEY }} ./Cpp2IL.Plugin.BuildReport/bin/Release/*.nupkg |
130 | | - - name: Publish Cpp2IL.Plugin.ControlFlowGraph |
131 | | - if: github.event_name == 'push' |
132 | | - run: dotnet nuget push -s https://nuget.samboy.dev/v3/index.json -k ${{ secrets.NUGET_KEY }} ./Cpp2IL.Plugin.ControlFlowGraph/bin/Release/*.nupkg |
133 | | - - name: Publish Cpp2IL.Plugin.OrbisPkg |
134 | | - if: github.event_name == 'push' |
135 | | - run: dotnet nuget push -s https://nuget.samboy.dev/v3/index.json -k ${{ secrets.NUGET_KEY }} ./Cpp2IL.Plugin.OrbisPkg/bin/Release/*.nupkg |
136 | | - - name: Publish Cpp2IL.Plugin.Pdb |
137 | | - if: github.event_name == 'push' |
138 | | - run: dotnet nuget push -s https://nuget.samboy.dev/v3/index.json -k ${{ secrets.NUGET_KEY }} ./Cpp2IL.Plugin.Pdb/bin/Release/*.nupkg |
139 | | - - name: Publish Cpp2IL.Plugin.StrippedCodeRegSupport |
140 | | - if: github.event_name == 'push' |
141 | | - run: dotnet nuget push -s https://nuget.samboy.dev/v3/index.json -k ${{ secrets.NUGET_KEY }} ./Cpp2IL.Plugin.StrippedCodeRegSupport/bin/Release/*.nupkg |
142 | | - |
| 11 | + release-net9: |
| 12 | + strategy: |
| 13 | + matrix: |
| 14 | + runtimeIdentifier: [ linux-x64, linux-arm64, osx-x64, osx-arm64, win-x64, win-arm64 ] |
| 15 | + project: [ Cpp2IL ] |
| 16 | + name: Build Single-File Artifact |
| 17 | + runs-on: ubuntu-latest |
| 18 | + steps: |
| 19 | + - uses: actions/checkout@v4 |
| 20 | + - uses: actions/setup-dotnet@v4.1.0 |
| 21 | + with: |
| 22 | + dotnet-version: 9.x |
| 23 | + - id: git-vars |
| 24 | + name: Get git branch information |
| 25 | + shell: bash |
| 26 | + run: | |
| 27 | + echo "##[set-output name=git_branch;]$(echo $GITHUB_REF)" |
| 28 | + echo "::set-output name=git_hash::$(git rev-parse --short HEAD)" |
| 29 | + - id: set-vars |
| 30 | + uses: actions/github-script@v7 |
| 31 | + with: |
| 32 | + script: | |
| 33 | + core.setOutput("extension", "${{ matrix.runtimeIdentifier }}" === "win-x64" ? ".exe" : ""); |
| 34 | + |
| 35 | + let gitHash = "${{ steps.git-vars.outputs.git_hash }}"; |
| 36 | + let runNumber = "${{ github.run_number }}"; |
| 37 | + let rawGitRef = "${{ steps.git-vars.outputs.git_branch }}"; |
| 38 | + console.log("rawGitRef: " + rawGitRef); |
| 39 | + let gitRef = rawGitRef.replace(/^refs\/heads\//, ""); |
| 40 | + if(gitRef.indexOf("refs/pull/") === 0) { |
| 41 | + gitRef = "pr-" + gitRef.substring(10, gitRef.lastIndexOf("/")); |
| 42 | + } |
| 43 | + var versString = `${gitRef}.${runNumber}+${gitHash}`; |
| 44 | + console.log(versString); |
| 45 | + core.setOutput("versionString", versString); |
| 46 | + - name: Restore |
| 47 | + run: dotnet restore -r ${{ matrix.runtimeIdentifier }} /p:VersionSuffix=${{ steps.set-vars.outputs.versionString }} |
| 48 | + - name: Build |
| 49 | + working-directory: ./${{ matrix.project }}/ |
| 50 | + run: dotnet publish -c Release -f net9.0 -r ${{ matrix.runtimeIdentifier }} /p:VersionSuffix=${{ steps.set-vars.outputs.versionString }} --no-restore --self-contained |
| 51 | + - name: Upload Executable |
| 52 | + uses: actions/upload-artifact@v4 |
| 53 | + with: |
| 54 | + name: ${{ matrix.project }}-net9-${{ matrix.runtimeIdentifier }} |
| 55 | + path: ./${{ matrix.project }}/bin/Release/net9.0/${{ matrix.runtimeIdentifier }}/publish/${{ matrix.project }}${{ steps.set-vars.outputs.extension }} |
| 56 | + release-netframework: |
| 57 | + name: Build - Windows .NET Framework Zip |
| 58 | + runs-on: ubuntu-latest |
| 59 | + steps: |
| 60 | + - uses: actions/checkout@v4 |
| 61 | + - uses: actions/setup-dotnet@v4.1.0 |
| 62 | + with: |
| 63 | + dotnet-version: 9.x |
| 64 | + - name: Install dependencies |
| 65 | + run: dotnet restore -r win-x64 |
| 66 | + - name: Build |
| 67 | + working-directory: ./Cpp2IL/ |
| 68 | + run: dotnet publish -c Release -f net472 --no-restore -r win-x64 |
| 69 | + - name: Upload |
| 70 | + uses: actions/upload-artifact@v4 |
| 71 | + with: |
| 72 | + name: Cpp2IL-Netframework472-Windows |
| 73 | + path: ./Cpp2IL/bin/Release/net472/win-x64/publish/ |
| 74 | + tests: |
| 75 | + name: Run Tests & Publish Dev Package |
| 76 | + runs-on: ubuntu-latest |
| 77 | + if: github.repository == 'SamboyCoding/Cpp2IL' |
| 78 | + steps: |
| 79 | + - uses: actions/checkout@v4 |
| 80 | + - uses: actions/setup-dotnet@v4.1.0 |
| 81 | + with: |
| 82 | + dotnet-version: 9.x |
| 83 | + - id: git-vars |
| 84 | + name: Set up environment |
| 85 | + shell: bash |
| 86 | + run: | |
| 87 | + echo "##[set-output name=git_branch;]$(echo $GITHUB_REF)" |
| 88 | + echo "::set-output name=git_hash::$(git rev-parse --short HEAD)" |
| 89 | + - id: set-vars |
| 90 | + uses: actions/github-script@v7 |
| 91 | + with: |
| 92 | + script: | |
| 93 | + let gitHash = "${{ steps.git-vars.outputs.git_hash }}"; |
| 94 | + let runNumber = "${{ github.run_number }}"; |
| 95 | + let rawGitRef = "${{ steps.git-vars.outputs.git_branch }}"; |
| 96 | + console.log("rawGitRef: " + rawGitRef); |
| 97 | + let gitRef = rawGitRef.replace(/^refs\/heads\//, ""); |
| 98 | + if(gitRef.indexOf("refs/pull/") === 0) { |
| 99 | + gitRef = "pr-" + gitRef.substring(10, gitRef.lastIndexOf("/")); |
| 100 | + } |
| 101 | + var versString = `${gitRef}.${runNumber}+${gitHash}`; |
| 102 | + console.log(versString); |
| 103 | + core.setOutput("versionString", versString); |
| 104 | + - name: Install dependencies |
| 105 | + run: dotnet restore /p:VersionSuffix=${{ steps.set-vars.outputs.versionString }} |
| 106 | + - name: Build all |
| 107 | + run: dotnet build -c Release /p:VersionSuffix=${{ steps.set-vars.outputs.versionString }} |
| 108 | + - name: Run Tests |
| 109 | + run: dotnet test -c Release /p:VersionSuffix=${{ steps.set-vars.outputs.versionString }} --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=lcov /p:CoverletOutput='./lcov.info' /p:ExcludeByAttribute="LibCpp2IL.Coverage.NoCoverageAttribute" |
| 110 | + - name: Upload Coverage |
| 111 | + uses: coverallsapp/github-action@v2.3.4 |
| 112 | + with: |
| 113 | + github-token: ${{ secrets.GITHUB_TOKEN }} |
| 114 | + files: ./Cpp2IL.Core.Tests/lcov.info ./LibCpp2ILTests/lcov.info |
| 115 | + - name: Publish StableNameDotNet |
| 116 | + if: github.event_name == 'push' |
| 117 | + run: dotnet nuget push -s https://nuget.samboy.dev/v3/index.json -k ${{ secrets.NUGET_KEY }} ./StableNameDotNet/bin/Release/*.nupkg |
| 118 | + - name: Publish WasmDisassembler |
| 119 | + if: github.event_name == 'push' |
| 120 | + run: dotnet nuget push -s https://nuget.samboy.dev/v3/index.json -k ${{ secrets.NUGET_KEY }} ./WasmDisassembler/bin/Release/*.nupkg |
| 121 | + - name: Publish LibCpp2IL |
| 122 | + if: github.event_name == 'push' |
| 123 | + run: dotnet nuget push -s https://nuget.samboy.dev/v3/index.json -k ${{ secrets.NUGET_KEY }} ./LibCpp2IL/bin/Release/*.nupkg |
| 124 | + - name: Publish Cpp2IL.Core |
| 125 | + if: github.event_name == 'push' |
| 126 | + run: dotnet nuget push -s https://nuget.samboy.dev/v3/index.json -k ${{ secrets.NUGET_KEY }} ./Cpp2IL.Core/bin/Release/*.nupkg |
| 127 | + - name: Publish Cpp2IL.Plugin.BuildReport |
| 128 | + if: github.event_name == 'push' |
| 129 | + run: dotnet nuget push -s https://nuget.samboy.dev/v3/index.json -k ${{ secrets.NUGET_KEY }} ./Cpp2IL.Plugin.BuildReport/bin/Release/*.nupkg |
| 130 | + - name: Publish Cpp2IL.Plugin.ControlFlowGraph |
| 131 | + if: github.event_name == 'push' |
| 132 | + run: dotnet nuget push -s https://nuget.samboy.dev/v3/index.json -k ${{ secrets.NUGET_KEY }} ./Cpp2IL.Plugin.ControlFlowGraph/bin/Release/*.nupkg |
| 133 | + - name: Publish Cpp2IL.Plugin.OrbisPkg |
| 134 | + if: github.event_name == 'push' |
| 135 | + run: dotnet nuget push -s https://nuget.samboy.dev/v3/index.json -k ${{ secrets.NUGET_KEY }} ./Cpp2IL.Plugin.OrbisPkg/bin/Release/*.nupkg |
| 136 | + - name: Publish Cpp2IL.Plugin.Pdb |
| 137 | + if: github.event_name == 'push' |
| 138 | + run: dotnet nuget push -s https://nuget.samboy.dev/v3/index.json -k ${{ secrets.NUGET_KEY }} ./Cpp2IL.Plugin.Pdb/bin/Release/*.nupkg |
| 139 | + - name: Publish Cpp2IL.Plugin.StrippedCodeRegSupport |
| 140 | + if: github.event_name == 'push' |
| 141 | + run: dotnet nuget push -s https://nuget.samboy.dev/v3/index.json -k ${{ secrets.NUGET_KEY }} ./Cpp2IL.Plugin.StrippedCodeRegSupport/bin/Release/*.nupkg |
| 142 | + - name: Publish Cpp2IL.Plugin.Mfuscator |
| 143 | + if: github.event_name == 'push' |
| 144 | + run: dotnet nuget push -s https://nuget.samboy.dev/v3/index.json -k ${{ secrets.NUGET_KEY }} ./Cpp2IL.Plugin.Mfuscator/bin/Release/*.nupkg |
0 commit comments