@@ -85,21 +85,64 @@ jobs:
8585 CI : True
8686 XUNIT_PATH : .\tests\ImageSharp.Drawing.Tests # Required for xunit
8787
88+ # Avoid "Please provide the repository token to upload reports via `-t :repository-token`"
89+ # https://community.codecov.io/t/whitelist-github-action-servers-to-upload-without-a-token/491/10
90+ # https://github.community/t5/GitHub-Actions/Make-secrets-available-to-builds-of-forks/m-p/42814/highlight/true#M5129
8891 - name : Update Codecov
8992 uses : iansu/codecov-action-node@v1.0.0
90- if : matrix.options.codecov == true
93+ if : matrix.options.codecov == true && startsWith(github.repository, 'SixLabors')
9194 with :
92- token : ${{secrets.CODECOV_TOKEN}}
93- file : " coverage.${{matrix.options.framework}}.xml"
95+ token : 0ef021c7-2679-4012-b42f-4bed33d99450
9496 flags : unittests
9597
96- - name : Pack # We can use this filter as we know it happens only once and takes the most time to complete.
97- if : (github.event_name == 'push') && (matrix.options.codecov == true)
98+ Publish :
99+ needs : [Build]
100+
101+ runs-on : windows-latest
102+
103+ if : (github.event_name == 'push')
104+
105+ steps :
106+ - uses : actions/checkout@v2
107+
108+ - name : Install NuGet
109+ uses : NuGet/setup-nuget@v1
110+
111+ - name : Setup Git
112+ shell : bash
113+ run : |
114+ git config --global core.autocrlf false
115+ git config --global core.longpaths true
116+ git fetch --prune --unshallow
117+ git submodule -q update --init --recursive
118+
119+ - name : Fetch Tags for GitVersion
120+ run : |
121+ git fetch --tags
122+
123+ - name : Fetch master for GitVersion
124+ if : github.ref != 'refs/heads/master'
125+ run : git branch --create-reflog master origin/master
126+
127+ - name : Install GitVersion
128+ uses : gittools/actions/setup-gitversion@v0.3
129+ with :
130+ versionSpec : " 5.1.x"
131+
132+ - name : Use GitVersion
133+ id : gitversion # step id used as reference for output values
134+ uses : gittools/actions/execute-gitversion@v0.3
135+
136+ - name : Setup DotNet SDK
137+ uses : actions/setup-dotnet@v1
138+ with :
139+ dotnet-version : " 3.1.101"
140+
141+ - name : Pack
98142 shell : pwsh
99- run : ./ci-build .ps1 "${{steps.gitversion.outputs.nuGetVersion}}"
143+ run : ./ci-pack .ps1 "${{steps.gitversion.outputs.nuGetVersion}}"
100144
101145 - name : Publish to MyGet
102- if : (github.event_name == 'push') && (matrix.options.codecov == true)
103146 shell : pwsh
104147 run : nuget.exe push .\artifacts\*.nupkg ${{secrets.MYGET_TOKEN}} -Source https://www.myget.org/F/sixlabors/api/v2/package
105148 # 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