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