Skip to content

Commit 43425d4

Browse files
committed
ci: build snapshot
1 parent 23d3518 commit 43425d4

1 file changed

Lines changed: 56 additions & 13 deletions

File tree

.github/workflows/workflow.yaml

Lines changed: 56 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -73,27 +73,17 @@
7373
go-lint \
7474
;
7575
'shell': 'bash'
76-
- 'name': 'Set up Node'
77-
'uses': 'actions/setup-node@v1'
76+
- 'uses': 'actions/setup-node@v7'
7877
'with':
7978
'node-version': '${{ env.NODE_VERSION }}'
80-
- 'name': 'Get npm cache directory'
81-
'id': 'npm-cache'
82-
'run': 'echo "::set-output name=dir::$( npm config get cache )"'
83-
- 'name': 'Set up npm cache'
84-
'uses': 'actions/cache@v4'
85-
'with':
86-
'path': '${{ steps.npm-cache.outputs.dir }}'
87-
'key': "${{ runner.os }}-node-${{ hashFiles('client/package-lock.json') }}"
88-
'restore-keys': '${{ runner.os }}-node-'
8979
- 'name': 'Run tests'
9080
'shell': 'bash'
9181
'run': |
9282
#!/bin/sh
9383
9484
set -e -f -u -x
9585
make \
96-
CLIENT_DIR=client \
86+
CLIENT_DIR=${{ env.CLIENT_DIR }} \
9787
VERBOSE=1 \
9888
deps \
9989
test \
@@ -106,7 +96,60 @@
10696
'with':
10797
'token': '${{ secrets.CODECOV_TOKEN }}'
10898
'file': './cover.out'
109-
# TODO(d.kolyshev): !! Build snapshot.
99+
'BuildSnapshot':
100+
'if': |
101+
${{ github.repository_owner != 'AdGuardSoftwareLimited' }}
102+
'needs': 'TestJob'
103+
'permissions':
104+
'contents': 'read'
105+
'runs-on': 'ubuntu-latest'
106+
'steps':
107+
- 'uses': 'actions/checkout@v6'
108+
'with':
109+
# Set fetch-depth for correct version parsing.
110+
'fetch-depth': '0'
111+
# Set to false to avoid GITHUB_TOKEN leaking.
112+
#
113+
# See https://github.com/actions/checkout/issues/485#issuecomment-934422611.
114+
'persist-credentials': false
115+
- 'uses': 'actions/setup-go@v6'
116+
'with':
117+
'go-version': '${{ env.GO_VERSION }}'
118+
- 'name': 'Set up Go modules cache'
119+
'uses': 'actions/cache@v4'
120+
'with':
121+
'path': '~/go/pkg/mod'
122+
'key': "${{ runner.os }}-go-${{ hashFiles('go.sum') }}"
123+
'restore-keys': '${{ runner.os }}-go-'
124+
- 'uses': 'actions/setup-node@v7'
125+
'with':
126+
'node-version': '${{ env.NODE_VERSION }}'
127+
- 'name': 'Set up Snapcraft'
128+
'run': |
129+
#!/bin/sh
130+
131+
set -e -f -u -x
132+
133+
sudo snap install snapcraft --classic
134+
- 'name': 'Set up QEMU'
135+
'uses': 'docker/setup-qemu-action@v3'
136+
- 'name': 'Set up Docker Buildx'
137+
'uses': 'docker/setup-buildx-action@v3'
138+
'with':
139+
'install': true
140+
- 'name': 'Run snapshot build'
141+
'run': |
142+
#!/bin/sh
143+
144+
set -e -f -u -x
145+
146+
make \
147+
CLIENT_DIR=${{ env.CLIENT_DIR }} \
148+
SIGN=0 \
149+
VERBOSE=1 \
150+
build-release \
151+
build-docker \
152+
;
110153
'name': 'Lint and test workflow'
111154
'on':
112155
'push':

0 commit comments

Comments
 (0)