|
1 | 1 | name: Build |
2 | 2 |
|
3 | 3 | on: |
4 | | - push: |
5 | | - branches: |
6 | | - - master |
7 | | - tags: |
8 | | - - "v*" |
9 | | - pull_request: |
10 | | - branches: |
11 | | - - master |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - master |
| 7 | + tags: |
| 8 | + - "v*" |
| 9 | + pull_request: |
| 10 | + branches: |
| 11 | + - master |
12 | 12 | jobs: |
13 | 13 | Build: |
14 | 14 | strategy: |
15 | 15 | matrix: |
16 | 16 | options: |
| 17 | + - os: ubuntu-latest |
| 18 | + framework: net6.0 |
| 19 | + sdk: 6.0.x |
| 20 | + sdk-preview: true |
| 21 | + runtime: -x64 |
| 22 | + codecov: false |
| 23 | + - os: macos-latest |
| 24 | + framework: net6.0 |
| 25 | + sdk: 6.0.x |
| 26 | + sdk-preview: true |
| 27 | + runtime: -x64 |
| 28 | + codecov: false |
| 29 | + - os: windows-latest |
| 30 | + framework: net6.0 |
| 31 | + sdk: 6.0.x |
| 32 | + sdk-preview: true |
| 33 | + runtime: -x64 |
| 34 | + codecov: false |
17 | 35 | - os: ubuntu-latest |
18 | 36 | framework: net5.0 |
19 | 37 | runtime: -x64 |
@@ -52,98 +70,133 @@ jobs: |
52 | 70 | codecov: false |
53 | 71 |
|
54 | 72 | runs-on: ${{matrix.options.os}} |
55 | | - if: "!contains(github.event.head_commit.message, '[skip ci]')" |
56 | 73 |
|
57 | 74 | steps: |
58 | | - - uses: actions/checkout@v2 |
| 75 | + - name: Git Config |
| 76 | + shell: bash |
| 77 | + run: | |
| 78 | + git config --global core.autocrlf false |
| 79 | + git config --global core.longpaths true |
| 80 | +
|
| 81 | + - name: Git Checkout |
| 82 | + uses: actions/checkout@v2 |
| 83 | + with: |
| 84 | + fetch-depth: 0 |
| 85 | + submodules: recursive |
59 | 86 |
|
60 | 87 | # See https://github.com/actions/checkout/issues/165#issuecomment-657673315 |
61 | | - - name: Create LFS file list |
| 88 | + - name: Git Create LFS FileList |
62 | 89 | run: git lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-assets-id |
63 | 90 |
|
64 | | - - name: Restore LFS cache |
| 91 | + - name: Git Setup LFS Cache |
65 | 92 | uses: actions/cache@v2 |
66 | 93 | id: lfs-cache |
67 | 94 | with: |
68 | 95 | path: .git/lfs |
69 | 96 | key: ${{ runner.os }}-lfs-${{ hashFiles('.lfs-assets-id') }}-v1 |
70 | 97 |
|
71 | | - - name: Git LFS Pull |
| 98 | + - name: Git Pull LFS |
72 | 99 | run: git lfs pull |
73 | 100 |
|
74 | | - - name: Install NuGet |
| 101 | + - name: NuGet Install |
75 | 102 | uses: NuGet/setup-nuget@v1 |
76 | 103 |
|
77 | | - - name: Setup Git |
78 | | - shell: bash |
79 | | - run: | |
80 | | - git config --global core.autocrlf false |
81 | | - git config --global core.longpaths true |
82 | | - git fetch --prune --unshallow |
83 | | - git submodule -q update --init --recursive |
84 | | -
|
85 | | - - name: Setup NuGet Cache |
| 104 | + - name: NuGet Setup Cache |
86 | 105 | uses: actions/cache@v2 |
87 | 106 | id: nuget-cache |
88 | 107 | with: |
89 | 108 | path: ~/.nuget |
90 | 109 | key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj', '**/*.props', '**/*.targets') }} |
91 | 110 | restore-keys: ${{ runner.os }}-nuget- |
92 | 111 |
|
93 | | - - name: Build |
| 112 | + - name: DotNet Setup Preview |
| 113 | + if: ${{ matrix.options.sdk-preview == true }} |
| 114 | + uses: actions/setup-dotnet@v1 |
| 115 | + with: |
| 116 | + dotnet-version: ${{ matrix.options.sdk }} |
| 117 | + include-prerelease: true |
| 118 | + |
| 119 | + - name: DotNet Build |
| 120 | + if: ${{ matrix.options.sdk-preview != true }} |
94 | 121 | shell: pwsh |
95 | 122 | run: ./ci-build.ps1 "${{matrix.options.framework}}" |
96 | 123 | env: |
97 | 124 | SIXLABORS_TESTING: True |
98 | 125 |
|
99 | | - - name: Test |
| 126 | + - name: DotNet Build Preview |
| 127 | + if: ${{ matrix.options.sdk-preview == true }} |
| 128 | + shell: pwsh |
| 129 | + run: ./ci-build.ps1 "${{matrix.options.framework}}" |
| 130 | + env: |
| 131 | + SIXLABORS_TESTING_PREVIEW: True |
| 132 | + |
| 133 | + - name: DotNet Test |
| 134 | + if: ${{ matrix.options.sdk-preview != true }} |
100 | 135 | shell: pwsh |
101 | 136 | run: ./ci-test.ps1 "${{matrix.options.os}}" "${{matrix.options.framework}}" "${{matrix.options.runtime}}" "${{matrix.options.codecov}}" |
102 | 137 | env: |
103 | | - SIXLABORS_TESTING: True |
104 | | - XUNIT_PATH: .\tests\ImageSharp.Tests # Required for xunit |
| 138 | + SIXLABORS_TESTING: True |
| 139 | + XUNIT_PATH: .\tests\ImageSharp.Tests # Required for xunit |
| 140 | + |
| 141 | + - name: DotNet Test Preview |
| 142 | + if: ${{ matrix.options.sdk-preview == true }} |
| 143 | + shell: pwsh |
| 144 | + run: ./ci-test.ps1 "${{matrix.options.os}}" "${{matrix.options.framework}}" "${{matrix.options.runtime}}" "${{matrix.options.codecov}}" |
| 145 | + env: |
| 146 | + SIXLABORS_TESTING_PREVIEW: True |
| 147 | + XUNIT_PATH: .\tests\ImageSharp.Tests # Required for xunit |
105 | 148 |
|
106 | 149 | - name: Export Failed Output |
107 | 150 | uses: actions/upload-artifact@v2 |
108 | 151 | if: failure() |
109 | 152 | with: |
110 | | - name: actual_output_${{ runner.os }}_${{ matrix.options.framework }}${{ matrix.options.runtime }}.zip |
111 | | - path: tests/Images/ActualOutput/ |
| 153 | + name: actual_output_${{ runner.os }}_${{ matrix.options.framework }}${{ matrix.options.runtime }}.zip |
| 154 | + path: tests/Images/ActualOutput/ |
112 | 155 |
|
113 | | - - name: Update Codecov |
| 156 | + - name: Codecov Update |
114 | 157 | uses: codecov/codecov-action@v1 |
115 | 158 | if: matrix.options.codecov == true && startsWith(github.repository, 'SixLabors') |
116 | 159 | with: |
117 | | - flags: unittests |
| 160 | + flags: unittests |
118 | 161 |
|
119 | 162 | Publish: |
120 | 163 | needs: [Build] |
121 | 164 |
|
122 | | - runs-on: windows-latest |
| 165 | + runs-on: ubuntu-latest |
123 | 166 |
|
124 | 167 | if: (github.event_name == 'push') |
125 | 168 |
|
126 | 169 | steps: |
127 | | - - uses: actions/checkout@v2 |
128 | | - |
129 | | - - name: Install NuGet |
130 | | - uses: NuGet/setup-nuget@v1 |
131 | | - |
132 | | - - name: Setup Git |
| 170 | + - name: Git Config |
133 | 171 | shell: bash |
134 | 172 | run: | |
135 | 173 | git config --global core.autocrlf false |
136 | 174 | git config --global core.longpaths true |
137 | | - git fetch --prune --unshallow |
138 | | - git submodule -q update --init --recursive |
139 | 175 |
|
140 | | - - name: Pack |
| 176 | + - name: Git Checkout |
| 177 | + uses: actions/checkout@v2 |
| 178 | + with: |
| 179 | + fetch-depth: 0 |
| 180 | + submodules: recursive |
| 181 | + |
| 182 | + - name: NuGet Install |
| 183 | + uses: NuGet/setup-nuget@v1 |
| 184 | + |
| 185 | + - name: NuGet Setup Cache |
| 186 | + uses: actions/cache@v2 |
| 187 | + id: nuget-cache |
| 188 | + with: |
| 189 | + path: ~/.nuget |
| 190 | + key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj', '**/*.props', '**/*.targets') }} |
| 191 | + restore-keys: ${{ runner.os }}-nuget- |
| 192 | + |
| 193 | + - name: DotNet Pack |
141 | 194 | shell: pwsh |
142 | 195 | run: ./ci-pack.ps1 |
143 | 196 |
|
144 | | - - name: Publish to MyGet |
| 197 | + - name: MyGet Publish |
145 | 198 | shell: pwsh |
146 | 199 | run: | |
147 | | - nuget.exe push .\artifacts\*.nupkg ${{secrets.MYGET_TOKEN}} -Source https://www.myget.org/F/sixlabors/api/v2/package |
148 | | - nuget.exe push .\artifacts\*.snupkg ${{secrets.MYGET_TOKEN}} -Source https://www.myget.org/F/sixlabors/api/v3/index.json |
| 200 | + dotnet nuget push .\artifacts\*.nupkg -k ${{secrets.MYGET_TOKEN}} -s https://www.myget.org/F/sixlabors/api/v2/package |
| 201 | + dotnet nuget push .\artifacts\*.snupkg -k ${{secrets.MYGET_TOKEN}} -s https://www.myget.org/F/sixlabors/api/v3/index.json |
149 | 202 | # TODO: If github.ref starts with 'refs/tags' then it was tag push and we can optionally push out package to nuget.org |
0 commit comments