Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 30d1595

Browse files
authored
Merge branch 'main' into imgbot
2 parents a6005bd + e4096d5 commit 30d1595

File tree

105 files changed

+3347
-1818
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

105 files changed

+3347
-1818
lines changed

.github/CODEOWNERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@
33
ci/helm-chart/ @Matthew-Beckett @alexgorbatchev
44

55
docs/install.md @GNUxeava
6+
7+
src/node/i18n/locales/zh-cn.json @zhaozhiming

.github/dependabot.yaml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "monthly"
7+
time: "06:00"
8+
timezone: "America/Chicago"
9+
labels: []
10+
commit-message:
11+
prefix: "chore"
12+
13+
- package-ecosystem: "npm"
14+
directory: "/"
15+
schedule:
16+
interval: "monthly"
17+
time: "06:00"
18+
timezone: "America/Chicago"
19+
commit-message:
20+
prefix: "chore"
21+
labels: []
22+
ignore:
23+
# Ignore patch updates for all dependencies
24+
- dependency-name: "*"
25+
update-types:
26+
- version-update:semver-patch
27+
# Ignore major updates to Node.js types, because they need to
28+
# correspond to the Node.js engine version
29+
- dependency-name: "@types/node"
30+
update-types:
31+
- version-update:semver-major

.github/workflows/build.yaml

Lines changed: 73 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545

4646
- name: Get changed files
4747
id: changed-files
48-
uses: tj-actions/changed-files@v26.1
48+
uses: tj-actions/changed-files@v36
4949
with:
5050
files: |
5151
docs/**
@@ -76,14 +76,14 @@ jobs:
7676

7777
- name: Get changed files
7878
id: changed-files
79-
uses: tj-actions/changed-files@v26.1
79+
uses: tj-actions/changed-files@v36
8080
with:
8181
files: |
8282
ci/helm-chart/**
8383
8484
- name: Install helm
8585
if: steps.changed-files.outputs.any_changed == 'true'
86-
uses: azure/setup-helm@v3.4
86+
uses: azure/setup-helm@v3.5
8787
with:
8888
token: ${{ secrets.GITHUB_TOKEN }}
8989

@@ -107,7 +107,7 @@ jobs:
107107

108108
- name: Get changed files
109109
id: changed-files
110-
uses: tj-actions/changed-files@v26.1
110+
uses: tj-actions/changed-files@v36
111111
with:
112112
files: |
113113
**/*.ts
@@ -139,6 +139,67 @@ jobs:
139139
if: steps.changed-files.outputs.any_changed == 'true'
140140
run: yarn lint:ts
141141

142+
lint-actions:
143+
name: Lint GitHub Actions
144+
runs-on: ubuntu-latest
145+
steps:
146+
- name: Checkout repo
147+
uses: actions/checkout@v3
148+
- name: Check workflow files
149+
run: |
150+
bash <(curl https://raw.githubusercontent.com/rhysd/actionlint/7fdc9630cc360ea1a469eed64ac6d78caeda1234/scripts/download-actionlint.bash)
151+
./actionlint -color -shellcheck= -ignore "set-output"
152+
shell: bash
153+
154+
test-unit:
155+
name: Run unit tests
156+
runs-on: ubuntu-20.04
157+
timeout-minutes: 5
158+
steps:
159+
- name: Checkout repo
160+
uses: actions/checkout@v3
161+
with:
162+
fetch-depth: 2
163+
164+
- name: Get changed files
165+
id: changed-files
166+
uses: tj-actions/changed-files@v36
167+
with:
168+
files: |
169+
**/*.ts
170+
files_ignore: |
171+
lib/vscode/**
172+
173+
- name: Install Node.js v16
174+
if: steps.changed-files.outputs.any_changed == 'true'
175+
uses: actions/setup-node@v3
176+
with:
177+
node-version: "16"
178+
179+
- name: Fetch dependencies from cache
180+
if: steps.changed-files.outputs.any_changed == 'true'
181+
id: cache-node-modules
182+
uses: actions/cache@v3
183+
with:
184+
path: "**/node_modules"
185+
key: yarn-build-${{ hashFiles('**/yarn.lock') }}
186+
restore-keys: |
187+
yarn-build-
188+
189+
- name: Install dependencies
190+
if: steps.changed-files.outputs.any_changed == 'true' && steps.cache-node-modules.outputs.cache-hit != 'true'
191+
run: SKIP_SUBMODULE_DEPS=1 yarn --frozen-lockfile
192+
193+
- name: Run unit tests
194+
if: steps.changed-files.outputs.any_changed == 'true'
195+
run: yarn test:unit
196+
197+
- name: Upload coverage report to Codecov
198+
uses: codecov/codecov-action@v3
199+
with:
200+
token: ${{ secrets.CODECOV_TOKEN }}
201+
if: success()
202+
142203
build:
143204
name: Build code-server
144205
runs-on: ubuntu-20.04
@@ -170,22 +231,24 @@ jobs:
170231
uses: actions/cache@v3
171232
with:
172233
path: "**/node_modules"
173-
key: yarn-build-${{ hashFiles('**/yarn.lock') }}
234+
key: yarn-build-code-server-${{ hashFiles('**/yarn.lock') }}
174235
restore-keys: |
175-
yarn-build-
236+
yarn-build-code-server-
176237
177238
- name: Install dependencies
178239
if: steps.cache-node-modules.outputs.cache-hit != 'true'
179240
run: yarn --frozen-lockfile
180241

181242
- name: Build code-server
243+
env:
244+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
182245
run: yarn build
183246

184247
# Get Code's git hash. When this changes it means the content is
185248
# different and we need to rebuild.
186249
- name: Get latest lib/vscode rev
187250
id: vscode-rev
188-
run: echo "::set-output name=rev::$(git rev-parse HEAD:./lib/vscode)"
251+
run: echo "rev=$(git rev-parse HEAD:./lib/vscode)" >> $GITHUB_OUTPUT
189252

190253
# We need to rebuild when we have a new version of Code, when any of
191254
# the patches changed, or when the code-server version changes (since
@@ -204,19 +267,6 @@ jobs:
204267
if: steps.cache-vscode.outputs.cache-hit != 'true'
205268
run: yarn build:vscode
206269

207-
# Our code imports code from VS Code's `out` directory meaning VS Code
208-
# must be built before running these tests.
209-
# TODO: Move to its own step?
210-
- name: Run code-server unit tests
211-
run: yarn test:unit
212-
if: success()
213-
214-
- name: Upload coverage report to Codecov
215-
uses: codecov/codecov-action@v3
216-
with:
217-
token: ${{ secrets.CODECOV_TOKEN }}
218-
if: success()
219-
220270
# The release package does not contain any native modules
221271
# and is neutral to architecture/os/libc version.
222272
- name: Create release package
@@ -233,65 +283,6 @@ jobs:
233283
name: npm-package
234284
path: ./package.tar.gz
235285

236-
npm:
237-
name: Publish npm package
238-
# the npm-package gets uploaded as an artifact in Build
239-
# so we need that to complete before this runs
240-
needs: build
241-
# This environment "npm" requires someone from
242-
# coder/code-server-reviewers to approve the PR before this job runs.
243-
environment: npm
244-
# Only run if PR comes from base repo or event is not a PR
245-
# Reason: forks cannot access secrets and this will always fail
246-
if: github.event.pull_request.head.repo.full_name == github.repository || github.event_name != 'pull_request'
247-
runs-on: ubuntu-20.04
248-
steps:
249-
- name: Checkout repo
250-
uses: actions/checkout@v3
251-
252-
- name: Download artifact
253-
uses: actions/download-artifact@v3
254-
id: download
255-
with:
256-
name: "npm-package"
257-
path: release-npm-package
258-
259-
- name: Run ./ci/steps/publish-npm.sh
260-
run: yarn publish:npm
261-
env:
262-
# NOTE@jsjoeio
263-
# This is because npm enforces semantic versioning
264-
# so it has to be a valid version. We only use this
265-
# to publish dev versions from prs
266-
# and beta versions from main.
267-
VERSION: "0.0.0"
268-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
269-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
270-
# NOTE@jsjoeio
271-
# NPM_ENVIRONMENT intentionally not set here.
272-
# Instead, itis determined in publish-npm.sh script
273-
# using GITHUB environment variables
274-
275-
- name: Comment npm information
276-
uses: marocchino/sticky-pull-request-comment@v2
277-
with:
278-
GITHUB_TOKEN: ${{ github.token }}
279-
header: npm-dev-build
280-
message: |
281-
✨ code-server dev build published to npm for PR #${{ github.event.number }}!
282-
* _Last publish status_: success
283-
* _Commit_: ${{ github.event.pull_request.head.sha }}
284-
285-
To install in a local project, run:
286-
```shell-session
287-
npm install @coder/code-server-pr@${{ github.event.number }}
288-
```
289-
290-
To install globally, run:
291-
```shell-session
292-
npm install -g @coder/code-server-pr@${{ github.event.number }}
293-
```
294-
295286
test-e2e:
296287
name: Run e2e tests
297288
needs: build
@@ -336,7 +327,7 @@ jobs:
336327
./test/node_modules/.bin/playwright install
337328
338329
- name: Run end-to-end tests
339-
run: CODE_SERVER_TEST_ENTRY=./release yarn test:e2e --global-timeout 840000
330+
run: CODE_SERVER_TEST_ENTRY=./release yarn test:e2e
340331

341332
- name: Upload test artifacts
342333
if: always()
@@ -392,7 +383,7 @@ jobs:
392383
./test/node_modules/.bin/playwright install
393384
394385
- name: Cache Caddy
395-
uses: actions/cache@v2
386+
uses: actions/cache@v3
396387
id: caddy-cache
397388
with:
398389
path: |
@@ -405,7 +396,7 @@ jobs:
405396
if: steps.caddy-cache.outputs.cache-hit != 'true'
406397
run: |
407398
gh release download v2.5.2 --repo caddyserver/caddy --pattern "caddy_2.5.2_linux_amd64.tar.gz"
408-
mkdir -p ~/.cache/caddy
399+
mkdir -p ~/.cache/caddy
409400
tar -xzf caddy_2.5.2_linux_amd64.tar.gz --directory ~/.cache/caddy
410401
411402
- name: Start Caddy

.github/workflows/docs-preview.yaml

Lines changed: 0 additions & 46 deletions
This file was deleted.

.github/workflows/publish.yaml

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,14 @@ jobs:
2929
- name: Checkout code-server
3030
uses: actions/checkout@v3
3131

32+
- name: Install Node.js v16
33+
uses: actions/setup-node@v3
34+
with:
35+
node-version: "16"
36+
cache: "yarn"
37+
3238
- name: Download npm package from release artifacts
33-
uses: robinraju/release-downloader@v1.6
39+
uses: robinraju/release-downloader@v1.8
3440
with:
3541
repository: "coder/code-server"
3642
tag: ${{ github.event.inputs.version || github.ref_name }}
@@ -137,12 +143,14 @@ jobs:
137143
- name: Open PR
138144
# We need to git push -u otherwise gh will prompt
139145
# asking where to push the branch.
146+
env:
147+
VERSION: ${{ env.VERSION }}
140148
run: |
141-
git checkout -b update-version-${{ steps.version.outputs.version }}
142-
git add .
143-
git commit -m "chore: updating version to ${{ steps.version.outputs.version }}"
149+
git checkout -b update-version-${{ env.VERSION }}
150+
git add .
151+
git commit -m "chore: updating version to ${{ env.VERSION }}"
144152
git push -u origin $(git branch --show)
145-
gh pr create --repo coder/code-server-aur --title "chore: bump version to ${{ steps.version.outputs.version }}" --body "PR opened by @$GITHUB_ACTOR" --assignee $GITHUB_ACTOR
153+
gh pr create --repo coder/code-server-aur --title "chore: bump version to ${{ env.VERSION }}" --body "PR opened by @$GITHUB_ACTOR" --assignee $GITHUB_ACTOR
146154
docker:
147155
runs-on: ubuntu-20.04
148156
steps:
@@ -176,15 +184,15 @@ jobs:
176184
echo "VERSION=${TAG#v}" >> $GITHUB_ENV
177185
178186
- name: Download release artifacts
179-
uses: robinraju/release-downloader@v1.6
187+
uses: robinraju/release-downloader@v1.8
180188
with:
181189
repository: "coder/code-server"
182190
tag: v${{ env.VERSION }}
183191
fileName: "*.deb"
184192
out-file-path: "release-packages"
185193

186194
- name: Publish to Docker
187-
run: yarn publish:docker
195+
run: ./ci/steps/docker-buildx-push.sh
188196
env:
189197
VERSION: ${{ env.VERSION }}
190198
GITHUB_TOKEN: ${{ github.token }}

0 commit comments

Comments
 (0)