|
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 | + - main |
| 7 | + tags: |
| 8 | + - "v*" |
| 9 | + pull_request: |
| 10 | + branches: |
| 11 | + - main |
12 | 12 | jobs: |
13 | | - Build: |
14 | | - strategy: |
15 | | - matrix: |
16 | | - options: |
17 | | - - os: ubuntu-latest |
18 | | - framework: netcoreapp3.1 |
19 | | - runtime: -x64 |
20 | | - codecov: false |
21 | | - - os: macos-latest |
22 | | - framework: netcoreapp3.1 |
23 | | - runtime: -x64 |
24 | | - codecov: false |
25 | | - - os: windows-latest |
26 | | - framework: netcoreapp3.1 |
27 | | - runtime: -x64 |
28 | | - codecov: true |
29 | | - - os: windows-latest |
30 | | - framework: netcoreapp2.1 |
31 | | - runtime: -x64 |
32 | | - codecov: false |
33 | | - - os: windows-latest |
34 | | - framework: net472 |
35 | | - runtime: -x64 |
36 | | - codecov: false |
37 | | - - os: windows-latest |
38 | | - framework: net472 |
39 | | - runtime: -x86 |
40 | | - codecov: false |
41 | | - |
42 | | - runs-on: ${{matrix.options.os}} |
43 | | - if: "!contains(github.event.head_commit.message, '[skip ci]')" |
44 | | - |
45 | | - steps: |
46 | | - - name: Git Config |
47 | | - shell: bash |
48 | | - run: | |
49 | | - git config --global core.autocrlf false |
50 | | - git config --global core.longpaths true |
51 | | -
|
52 | | - - name: Git Checkout |
53 | | - uses: actions/checkout@v2 |
54 | | - with: |
55 | | - fetch-depth: 0 |
56 | | - submodules: recursive |
57 | | - |
58 | | - # See https://github.com/actions/checkout/issues/165#issuecomment-657673315 |
59 | | - - name: Git Create LFS FileList |
60 | | - run: git lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-assets-id |
61 | | - |
62 | | - - name: Git Setup LFS Cache |
63 | | - uses: actions/cache@v2 |
64 | | - id: lfs-cache |
65 | | - with: |
66 | | - path: .git/lfs |
67 | | - key: ${{ runner.os }}-lfs-${{ hashFiles('.lfs-assets-id') }}-v1 |
68 | | - |
69 | | - - name: Git Pull LFS |
70 | | - run: git lfs pull |
71 | | - |
72 | | - - name: NuGet Install |
73 | | - uses: NuGet/setup-nuget@v1 |
74 | | - |
75 | | - - name: NuGet Setup Cache |
76 | | - uses: actions/cache@v2 |
77 | | - id: nuget-cache |
78 | | - with: |
79 | | - path: ~/.nuget |
80 | | - key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj', '**/*.props', '**/*.targets') }} |
81 | | - restore-keys: ${{ runner.os }}-nuget- |
82 | | - |
83 | | - - name: DotNet Build |
84 | | - shell: pwsh |
85 | | - run: ./ci-build.ps1 |
86 | | - env: |
87 | | - SIXLABORS_TESTING: True |
88 | | - |
89 | | - - name: DotNet Test |
90 | | - shell: pwsh |
91 | | - run: ./ci-test.ps1 "${{matrix.options.os}}" "${{matrix.options.framework}}" "${{matrix.options.runtime}}" "${{matrix.options.codecov}}" |
92 | | - env: |
93 | | - SIXLABORS_TESTING: True |
94 | | - XUNIT_PATH: .\tests\ImageSharp.Drawing.Tests # Required for xunit |
95 | | - |
96 | | - - name: Export Failed Output |
97 | | - uses: actions/upload-artifact@v2 |
98 | | - if: failure() |
99 | | - with: |
100 | | - name: actual_output_${{ runner.os }}_${{ matrix.options.framework }}${{ matrix.options.runtime }}.zip |
101 | | - path: tests/Images/ActualOutput/ |
102 | | - |
103 | | - - name: Codecov Update |
104 | | - uses: codecov/codecov-action@v1 |
105 | | - if: matrix.options.codecov == true && startsWith(github.repository, 'SixLabors') |
106 | | - with: |
107 | | - flags: unittests |
108 | | - |
109 | | - Publish: |
110 | | - needs: [Build] |
111 | | - |
112 | | - runs-on: ubuntu-latest |
113 | | - |
114 | | - if: (github.event_name == 'push') |
115 | | - |
116 | | - steps: |
117 | | - - name: Git Config |
118 | | - shell: bash |
119 | | - run: | |
120 | | - git config --global core.autocrlf false |
121 | | - git config --global core.longpaths true |
122 | | -
|
123 | | - - name: Git Checkout |
124 | | - uses: actions/checkout@v2 |
125 | | - with: |
126 | | - fetch-depth: 0 |
127 | | - submodules: recursive |
128 | | - |
129 | | - - name: NuGet Install |
130 | | - uses: NuGet/setup-nuget@v1 |
131 | | - |
132 | | - - name: NuGet Setup Cache |
133 | | - uses: actions/cache@v2 |
134 | | - id: nuget-cache |
135 | | - with: |
136 | | - path: ~/.nuget |
137 | | - key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj', '**/*.props', '**/*.targets') }} |
138 | | - restore-keys: ${{ runner.os }}-nuget- |
139 | | - |
140 | | - - name: DotNet Pack |
141 | | - shell: pwsh |
142 | | - run: ./ci-pack.ps1 |
143 | | - |
144 | | - - name: MyGet Publish |
145 | | - shell: pwsh |
146 | | - run: | |
147 | | - dotnet nuget push .\artifacts\*.nupkg -k ${{secrets.MYGET_TOKEN}} -s https://www.myget.org/F/sixlabors/api/v2/package |
148 | | - dotnet nuget push .\artifacts\*.snupkg -k ${{secrets.MYGET_TOKEN}} -s https://www.myget.org/F/sixlabors/api/v3/index.json |
149 | | - # TODO: If github.ref starts with 'refs/tags' then it was tag push and we can optionally push out package to nuget.org |
| 13 | + Build: |
| 14 | + strategy: |
| 15 | + matrix: |
| 16 | + options: |
| 17 | + - os: ubuntu-latest |
| 18 | + framework: netcoreapp3.1 |
| 19 | + runtime: -x64 |
| 20 | + codecov: false |
| 21 | + - os: macos-latest |
| 22 | + framework: netcoreapp3.1 |
| 23 | + runtime: -x64 |
| 24 | + codecov: false |
| 25 | + - os: windows-latest |
| 26 | + framework: netcoreapp3.1 |
| 27 | + runtime: -x64 |
| 28 | + codecov: true |
| 29 | + - os: windows-latest |
| 30 | + framework: netcoreapp2.1 |
| 31 | + runtime: -x64 |
| 32 | + codecov: false |
| 33 | + - os: windows-latest |
| 34 | + framework: net472 |
| 35 | + runtime: -x64 |
| 36 | + codecov: false |
| 37 | + - os: windows-latest |
| 38 | + framework: net472 |
| 39 | + runtime: -x86 |
| 40 | + codecov: false |
| 41 | + |
| 42 | + runs-on: ${{matrix.options.os}} |
| 43 | + if: "!contains(github.event.head_commit.message, '[skip ci]')" |
| 44 | + |
| 45 | + steps: |
| 46 | + - name: Git Config |
| 47 | + shell: bash |
| 48 | + run: | |
| 49 | + git config --global core.autocrlf false |
| 50 | + git config --global core.longpaths true |
| 51 | +
|
| 52 | + - name: Git Checkout |
| 53 | + uses: actions/checkout@v2 |
| 54 | + with: |
| 55 | + fetch-depth: 0 |
| 56 | + submodules: recursive |
| 57 | + |
| 58 | + # See https://github.com/actions/checkout/issues/165#issuecomment-657673315 |
| 59 | + - name: Git Create LFS FileList |
| 60 | + run: git lfs ls-files -l | cut -d' ' -f1 | sort > .lfs-assets-id |
| 61 | + |
| 62 | + - name: Git Setup LFS Cache |
| 63 | + uses: actions/cache@v2 |
| 64 | + id: lfs-cache |
| 65 | + with: |
| 66 | + path: .git/lfs |
| 67 | + key: ${{ runner.os }}-lfs-${{ hashFiles('.lfs-assets-id') }}-v1 |
| 68 | + |
| 69 | + - name: Git Pull LFS |
| 70 | + run: git lfs pull |
| 71 | + |
| 72 | + - name: NuGet Install |
| 73 | + uses: NuGet/setup-nuget@v1 |
| 74 | + |
| 75 | + - name: NuGet Setup Cache |
| 76 | + uses: actions/cache@v2 |
| 77 | + id: nuget-cache |
| 78 | + with: |
| 79 | + path: ~/.nuget |
| 80 | + key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj', '**/*.props', '**/*.targets') }} |
| 81 | + restore-keys: ${{ runner.os }}-nuget- |
| 82 | + |
| 83 | + - name: DotNet Setup |
| 84 | + uses: actions/setup-dotnet@v1 |
| 85 | + with: |
| 86 | + dotnet-version: | |
| 87 | + 6.0.x |
| 88 | + 5.0.x |
| 89 | + 3.1.x |
| 90 | + 2.1.x |
| 91 | +
|
| 92 | + - name: DotNet Build |
| 93 | + shell: pwsh |
| 94 | + run: ./ci-build.ps1 |
| 95 | + env: |
| 96 | + SIXLABORS_TESTING: True |
| 97 | + |
| 98 | + - name: DotNet Test |
| 99 | + shell: pwsh |
| 100 | + run: ./ci-test.ps1 "${{matrix.options.os}}" "${{matrix.options.framework}}" "${{matrix.options.runtime}}" "${{matrix.options.codecov}}" |
| 101 | + env: |
| 102 | + SIXLABORS_TESTING: True |
| 103 | + XUNIT_PATH: .\tests\ImageSharp.Drawing.Tests # Required for xunit |
| 104 | + |
| 105 | + - name: Export Failed Output |
| 106 | + uses: actions/upload-artifact@v2 |
| 107 | + if: failure() |
| 108 | + with: |
| 109 | + name: actual_output_${{ runner.os }}_${{ matrix.options.framework }}${{ matrix.options.runtime }}.zip |
| 110 | + path: tests/Images/ActualOutput/ |
| 111 | + |
| 112 | + - name: Codecov Update |
| 113 | + uses: codecov/codecov-action@v1 |
| 114 | + if: matrix.options.codecov == true && startsWith(github.repository, 'SixLabors') |
| 115 | + with: |
| 116 | + flags: unittests |
| 117 | + |
| 118 | + Publish: |
| 119 | + needs: [Build] |
| 120 | + |
| 121 | + runs-on: ubuntu-latest |
| 122 | + |
| 123 | + if: (github.event_name == 'push') |
| 124 | + |
| 125 | + steps: |
| 126 | + - name: Git Config |
| 127 | + shell: bash |
| 128 | + run: | |
| 129 | + git config --global core.autocrlf false |
| 130 | + git config --global core.longpaths true |
| 131 | +
|
| 132 | + - name: Git Checkout |
| 133 | + uses: actions/checkout@v2 |
| 134 | + with: |
| 135 | + fetch-depth: 0 |
| 136 | + submodules: recursive |
| 137 | + |
| 138 | + - name: NuGet Install |
| 139 | + uses: NuGet/setup-nuget@v1 |
| 140 | + |
| 141 | + - name: NuGet Setup Cache |
| 142 | + uses: actions/cache@v2 |
| 143 | + id: nuget-cache |
| 144 | + with: |
| 145 | + path: ~/.nuget |
| 146 | + key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj', '**/*.props', '**/*.targets') }} |
| 147 | + restore-keys: ${{ runner.os }}-nuget- |
| 148 | + |
| 149 | + - name: DotNet Pack |
| 150 | + shell: pwsh |
| 151 | + run: ./ci-pack.ps1 |
| 152 | + |
| 153 | + - name: MyGet Publish |
| 154 | + shell: pwsh |
| 155 | + run: | |
| 156 | + dotnet nuget push .\artifacts\*.nupkg -k ${{secrets.MYGET_TOKEN}} -s https://www.myget.org/F/sixlabors/api/v2/package |
| 157 | + dotnet nuget push .\artifacts\*.snupkg -k ${{secrets.MYGET_TOKEN}} -s https://www.myget.org/F/sixlabors/api/v3/index.json |
| 158 | + # 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