Skip to content

Commit 0ec1c69

Browse files
committed
Switch fully to GH Actions
1 parent 193a451 commit 0ec1c69

File tree

10 files changed

+115
-172
lines changed

10 files changed

+115
-172
lines changed

.github/workflows/ci.yaml

+52-5
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,60 @@ name: ci
33
on: [push, pull_request]
44

55
jobs:
6-
arm64-release:
7-
name: linux-arm64-release
8-
runs-on: [Linux, ARM64]
6+
test:
7+
runs-on: ubuntu-latest
98
steps:
109
- uses: actions/checkout@v1
11-
- run: ./ci/steps/linux-release.sh
12-
- uses: actions/upload-artifact@v2
10+
- name: Run ./ci/steps/test.sh
11+
uses: ./ci/container
12+
with:
13+
args: ./ci/steps/test.sh
14+
15+
linux-amd64:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v1
19+
- name: Run ./ci/steps/release.sh
20+
uses: ./ci/container
21+
with:
22+
args: ./ci/steps/release.sh
23+
- name: Upload release artifacts
24+
uses: actions/upload-artifact@v2
25+
with:
26+
name: release-github
27+
path: ./release-github/*
28+
- name: Upload npm package artifact
29+
uses: actions/upload-artifact@v2
30+
with:
31+
name: npm-package
32+
path: ./release
33+
34+
linux-arm64:
35+
runs-on: ubuntu-arm64-latest
36+
steps:
37+
- uses: actions/checkout@v1
38+
- name: Run ./ci/steps/release.sh
39+
uses: ./ci/container
40+
with:
41+
args: ./ci/steps/release.sh
42+
- name: Upload release artifacts
43+
uses: actions/upload-artifact@v2
44+
with:
45+
name: release-github
46+
path: ./release-github/*
47+
48+
macos:
49+
runs-on: macos-latest
50+
steps:
51+
- uses: actions/checkout@v1
52+
- run: brew unlink node@12
53+
- run: brew install node
54+
- run: ./ci/steps/release.sh
55+
env:
56+
# Otherwise we get a rate limited when fetching the ripgrep binary.
57+
GITHUB_TOKEN: ${{ secrets.github_token }}
58+
- name: Upload release artifacts
59+
uses: actions/upload-artifact@v2
1360
with:
1461
name: release-github
1562
path: ./release-github/*

.travis.yml

-80
This file was deleted.

ci/README.md

+4-8
Original file line numberDiff line numberDiff line change
@@ -68,15 +68,11 @@ This directory contains the container for CI.
6868

6969
## steps
7070

71-
This directory contains a few scripts used in CI. Just helps avoid clobbering .travis.yml.
71+
This directory contains a few scripts used in CI.
72+
Just helps avoid clobbering .travis.yml.
7273

7374
- [./steps/test.sh](./steps/test.sh)
7475
- Runs `yarn ci` after ensuring VS Code is patched
75-
- [./steps/static-release.sh](./steps/static-release.sh)
76+
- [./steps/release.sh](./steps/release.sh)
7677
- Runs the full static build process for CI
77-
- [./steps/linux-release.sh](./steps/linux-release.sh)
78-
- Runs the full static build process for CI
79-
- Packages the release into a .deb and .rpm
80-
- Builds and pushes a docker release
81-
- [./steps/publish-npm.sh](./steps/publish-npm.sh)
82-
- Authenticates yarn and publishes the built package from `./release`
78+
- Packages the release into a .deb and .rpm for linux

ci/container/Dockerfile

+37-26
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,41 @@
1-
FROM centos:7
2-
3-
RUN yum update -y && yum install -y \
4-
devtoolset-6 \
5-
gcc-c++ \
6-
xz \
7-
ccache \
8-
git \
9-
wget \
10-
openssl \
11-
libxkbfile-devel \
12-
libsecret-devel \
13-
libx11-devel \
14-
gettext
15-
16-
RUN yum install -y epel-release && \
17-
yum install -y ShellCheck jq golang
1+
FROM debian
182

19-
RUN go get github.com/goreleaser/nfpm/cmd/nfpm
20-
ENV PATH=$PATH:/root/go/bin
3+
RUN apt-get update
4+
5+
# Needed for debian repositories added below.
6+
RUN apt-get install -y curl gnupg
7+
8+
# Installs node.
9+
RUN curl -sL https://deb.nodesource.com/setup_14.x | bash - && \
10+
apt-get install -y nodejs
11+
12+
# Installs yarn.
13+
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \
14+
echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list && \
15+
apt-get update && apt-get install -y yarn
2116

22-
RUN mkdir /usr/share/node && cd /usr/share/node \
23-
&& curl "https://nodejs.org/dist/v12.16.3/node-v12.16.3-linux-$(uname -m | sed 's/86_//; s/aarch/arm/').tar.xz" | tar xJ --strip-components=1 --
24-
ENV PATH "$PATH:/usr/share/node/bin"
25-
RUN npm install -g [email protected]
17+
# Installs VS Code build deps.
18+
RUN apt-get install -y build-essential \
19+
libsecret-1-dev \
20+
libx11-dev \
21+
libxkbfile-dev
2622

27-
RUN curl -L "https://github.com/mvdan/sh/releases/download/v3.0.1/shfmt_v3.0.1_linux_$(uname -m | sed 's/x86_/amd/; s/aarch64/arm/')" > /usr/local/bin/shfmt \
28-
&& chmod +x /usr/local/bin/shfmt
23+
# Installs envsubst.
24+
RUN apt-get install -y gettext-base
2925

30-
ENTRYPOINT ["/bin/bash", "-c"]
26+
# Misc build dependencies.
27+
RUN apt-get install -y jq git rsync
28+
29+
# Installs shellcheck.
30+
RUN curl -L https://github.com/koalaman/shellcheck/releases/download/v0.7.1/shellcheck-v0.7.1.linux.$(uname -m).tar.xz | \
31+
tar -xJ && \
32+
mv shellcheck*/shellcheck /usr/local/bin && \
33+
rm -R shellcheck*
34+
35+
# Install Go dependencies
36+
RUN ARCH="$(dpkg --print-architecture)" && \
37+
curl "https://dl.google.com/go/go1.14.2.linux-$ARCH.tar.gz" | tar -C /usr/local -xz
38+
ENV PATH=/usr/local/go/bin:/root/go/bin:$PATH
39+
ENV GO111MODULE=on
40+
RUN go get mvdan.cc/sh/v3/cmd/shfmt
41+
RUN go get github.com/goreleaser/nfpm/cmd/nfpm

ci/container/exec.sh

-24
This file was deleted.

ci/dev/vscode.patch

+16
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,22 @@ index 7a2320d828..5768890636 100644
4848
+// yarnInstall('test/smoke'); // node modules required for smoketest
4949
+// yarnInstall('test/integration/browser'); // node modules required for integration
5050
yarnInstallBuildDependencies(); // node modules for watching, specific to host node version, not electron
51+
diff --git a/build/npm/preinstall.js b/build/npm/preinstall.js
52+
index cb88d37ade..6b3253af0a 100644
53+
--- a/build/npm/preinstall.js
54+
+++ b/build/npm/preinstall.js
55+
@@ -8,8 +8,9 @@ let err = false;
56+
const majorNodeVersion = parseInt(/^(\d+)\./.exec(process.versions.node)[1]);
57+
58+
if (majorNodeVersion < 10 || majorNodeVersion >= 13) {
59+
- console.error('\033[1;31m*** Please use node >=10 and <=12.\033[0;0m');
60+
- err = true;
61+
+ // We are ok building above Node 12.
62+
+ // console.error('\033[1;31m*** Please use node >=10 and <=12.\033[0;0m');
63+
+ // err = true;
64+
}
65+
66+
const cp = require('child_process');
5167
diff --git a/coder.js b/coder.js
5268
new file mode 100644
5369
index 0000000000..0170b47241

ci/release-container/Dockerfile

+2-5
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,8 @@ ENV SHELL=/bin/bash
2727
RUN adduser --gecos '' --disabled-password coder && \
2828
echo "coder ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/nopasswd
2929

30-
SHELL ["/bin/bash", "-c"]
31-
32-
COPY ci/lib.sh /tmp/lib.sh
33-
RUN source /tmp/lib.sh && rm /tmp/lib.sh && \
34-
curl -L "https://github.com/boxboat/fixuid/releases/download/v0.4.1/fixuid-0.4.1-linux-$(arch).tar.gz" | tar -C /usr/local/bin -xzf - && \
30+
RUN ARCH="$(dpkg --print-architecture)" && \
31+
curl -L "https://github.com/boxboat/fixuid/releases/download/v0.4.1/fixuid-0.4.1-linux-$ARCH.tar.gz" | tar -C /usr/local/bin -xzf - && \
3532
chown root:root /usr/local/bin/fixuid && \
3633
chmod 4755 /usr/local/bin/fixuid && \
3734
mkdir -p /etc/fixuid && \

ci/steps/linux-release.sh

-13
This file was deleted.

ci/steps/publish-npm.sh

-11
This file was deleted.

ci/steps/static-release.sh renamed to ci/steps/release.sh

+4
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ main() {
1111
STATIC=1 yarn release
1212
./ci/build/test-static-release.sh
1313
./ci/build/archive-static-release.sh
14+
15+
if [[ $OSTYPE == linux* ]]; then
16+
yarn pkg
17+
fi
1418
}
1519

1620
main "$@"

0 commit comments

Comments
 (0)