Skip to content

Commit 001309c

Browse files
committed
Switch fully to GH Actions
1 parent 193a451 commit 001309c

File tree

10 files changed

+101
-171
lines changed

10 files changed

+101
-171
lines changed

.github/workflows/ci.yaml

+44-4
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,52 @@ 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
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+
- uses: actions/upload-artifact@v2
24+
with:
25+
name: release-github
26+
path: ./release-github/*
27+
- uses: actions/upload-artifact@v2
28+
with:
29+
name: npm-package
30+
path: ./release
31+
32+
linux-arm64:
33+
runs-on: ubuntu-arm64-latest
34+
steps:
35+
- uses: actions/checkout@v1
36+
- name: Run ./ci/steps/release.sh
37+
uses: ./ci/container
38+
with:
39+
args: ./ci/steps/release.sh
40+
- uses: actions/upload-artifact@v2
41+
with:
42+
name: release-github
43+
path: ./release-github/*
44+
45+
macos:
46+
runs-on: macos-latest
47+
steps:
48+
- uses: actions/checkout@v1
49+
- run: brew unlink node@12
50+
- run: brew install node
51+
- run: ./ci/steps/release.sh
1252
- uses: actions/upload-artifact@v2
1353
with:
1454
name: 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

+31-26
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,35 @@
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
2111

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 yarn@1.22.4
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
2616

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
17+
# Installs VS Code build deps.
18+
RUN apt-get install -y build-essential \
19+
libsecret-1-dev \
20+
libx11-dev \
21+
libxkbfile-dev
2922

30-
ENTRYPOINT ["/bin/bash", "-c"]
23+
# Installs envsubst.
24+
RUN apt-get install -y gettext-base
25+
26+
# Misc build dependencies.
27+
RUN apt-get install -y shellcheck jq git
28+
29+
# Install Go dependencies
30+
RUN ARCH="$(dpkg --print-architecture)" && \
31+
curl "https://dl.google.com/go/go1.14.2.linux-$ARCH.tar.gz" | tar -C /usr/local -xz
32+
ENV PATH=/usr/local/go/bin:/root/go/bin:$PATH
33+
ENV GO111MODULE=on
34+
RUN go get mvdan.cc/sh/v3/cmd/shfmt
35+
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)