1+ # TODO(a.garipov): Refactor this workflow.
12name : Build
23# Permissions are disabled for all the jobs by default, and then overridden for
34# specific jobs if needed. This is a recommended practice for security reasons,
@@ -6,16 +7,18 @@ name: Build
67# See https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax#permissions.
78' permissions ' : {}
89' env ' :
9- ' GO_VERSION ' : ' 1.26.3 '
10+ ' GO_VERSION ' : ' 1.26.4 '
1011' on ' :
1112 ' push ' :
1213 ' tags ' :
1314 - ' v*'
1415 ' branches ' :
1516 - ' *'
16- ' pull_request ' :
17+ ' pull_request ' : null
1718jobs :
1819 tests :
20+ 'if' : |
21+ ${{ github.repository_owner != 'AdGuardSoftwareLimited' }}
1922 ' permissions ' :
2023 ' contents ' : ' read'
2124 runs-on : ${{ matrix.os }}
@@ -32,21 +35,14 @@ jobs:
3235 #
3336 # See https://github.com/actions/checkout/issues/485#issuecomment-934422611.
3437 ' persist-credentials ' : false
35- - uses : actions/setup-go@v2
38+ - uses : actions/setup-go@v6
3639 with :
3740 go-version : ' ${{ env.GO_VERSION }}'
3841 - name : Run tests
39- env :
40- CI : " 1"
41- run : |-
42- make test
43- - name : Upload coverage
44- uses : codecov/codecov-action@v1
45- if : " success() && matrix.os == 'ubuntu-latest'"
46- with :
47- token : ${{ secrets.CODECOV_TOKEN }}
48- file : ./coverage.txt
42+ run : ' make test'
4943 build :
44+ 'if' : |
45+ ${{ github.repository_owner != 'AdGuardSoftwareLimited' }}
5046 needs :
5147 - tests
5248 ' permissions ' :
6056 #
6157 # See https://github.com/actions/checkout/issues/485#issuecomment-934422611.
6258 ' persist-credentials ' : false
63- - uses : actions/setup-go@v2
59+ - uses : actions/setup-go@v6
6460 with :
6561 go-version : ' ${{ env.GO_VERSION }}'
6662 - name : Build release
@@ -83,36 +79,10 @@ jobs:
8379 prerelease : false
8480 - name : Upload
8581 if : startsWith(github.ref, 'refs/tags/v')
86- uses : xresloader/upload-to-github-release@v1.3.12
82+ uses : xresloader/upload-to-github-release@v1.6.2
8783 env :
8884 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
8985 with :
9086 file : " build/dnsproxy-*.tar.gz;build/dnsproxy-*.zip"
9187 tags : true
9288 draft : false
93- notify :
94- needs :
95- - build
96- if : |
97- ${{ always() &&
98- (
99- github.event_name == 'push' ||
100- github.event.pull_request.head.repo.full_name == github.repository
101- )
102- }}
103- ' permissions ' :
104- # Required by workflow-conclusion-action to check workflow status.
105- ' actions ' : ' read'
106- ' contents ' : ' read'
107- runs-on : ubuntu-latest
108- steps :
109- - name : Conclusion
110- uses : technote-space/workflow-conclusion-action@v1
111- - name : Send Slack notif
112- uses : 8398a7/action-slack@v3
113- with :
114- status : ${{ env.WORKFLOW_CONCLUSION }}
115- fields : workflow, repo, message, commit, author, eventName,ref
116- env :
117- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
118- SLACK_WEBHOOK_URL : ${{ secrets.SLACK_WEBHOOK_URL }}
0 commit comments