-
-
Notifications
You must be signed in to change notification settings - Fork 191
135 lines (121 loc) · 5.82 KB
/
debian-package.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
# Copyright (C) 2020 Matthew Glazar
# See end of file for extended copyright information.
name: Debian package
on:
push:
pull_request:
types: [opened, synchronize]
jobs:
# TODO(strager): Also build ARM (32-bit) .deb-s.
build-deb:
name: build .deb ${{ matrix.os.arch }}
strategy:
fail-fast: false
matrix:
os:
- {arch: amd64, runs_on: ubuntu-latest, docker_container: "ghcr.io/quick-lint/quick-lint-js-github-baseline-builder:v1", build_env: ""}
- {arch: arm64, runs_on: stracle-linux-aarch64, docker_container: "ghcr.io/quick-lint/quick-lint-js-github-builder-aarch64:v1", build_env: ""}
runs-on: ${{ matrix.os.runs_on }}
container: ${{ matrix.os.docker_container }}
steps:
- name: checkout
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
# HACK(strager): Work around the following error from
# build.sh:
#
# fatal: detected dubious ownership in repository at '/__w/quick-lint-js/quick-lint-js'
#
# See also: https://github.com/actions/checkout/issues/760
- name: work around permission issue
run: git config --global --add safe.directory /__w/quick-lint-js/quick-lint-js
- name: build
run: ${{ matrix.os.build_env }} ./dist/debian/build.sh --bionic
- name: upload build to workflow
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
with:
if-no-files-found: error
name: quick-lint-js-deb-${{ matrix.os.arch }}-${{ github.sha }}
path: |
dist/debian/build/quick-lint-js-dbgsym_*
dist/debian/build/quick-lint-js-vim_*
dist/debian/build/quick-lint-js_*
- name: upload build to long-term storage
if: ${{ github.event_name == 'push' && github.repository_owner == 'quick-lint' != null }}
uses: quick-lint/sftp-upload@1fa54164d4bdd081207a6e54ec143d8dda3a7fb8 # v3
with:
host: ${{ secrets.artifacts_host }}
local-file-globs: |
dist/debian/build/quick-lint-js-dbgsym_*
dist/debian/build/quick-lint-js-vim_*
dist/debian/build/quick-lint-js_*
private-key: ${{ secrets.artifacts_key }}
remote-directory: ${{ secrets.artifacts_root }}/builds/${{ github.sha }}/debian/${{ matrix.os.arch }}/
user: ${{ secrets.artifacts_user }}
test-deb:
name: test on ${{ matrix.os.name }} ${{ matrix.os.arch }}
needs: build-deb
strategy:
fail-fast: false
matrix:
os:
- {arch: amd64, runs_on: ubuntu-latest, docker_container: "debian:bullseye", name: "Debian 11 Bullseye"}
- {arch: amd64, runs_on: ubuntu-latest, docker_container: "debian:buster", name: "Debian 10 Buster"}
- {arch: amd64, runs_on: ubuntu-latest, docker_container: "pureos/pureos:amber-latest", name: "PureOS Amber"}
- {arch: amd64, runs_on: ubuntu-latest, docker_container: "ubuntu:16.04", name: "Ubuntu 16.04 LTS Xenial", install_node_20_ubuntu: true}
- {arch: amd64, runs_on: ubuntu-latest, docker_container: "ubuntu:18.04", name: "Ubuntu 18.04 LTS Bionic", install_node_20_ubuntu: true}
- {arch: amd64, runs_on: ubuntu-latest, docker_container: "ubuntu:20.04", name: "Ubuntu 20.04 LTS Focal"}
- {arch: arm64, runs_on: stracle-linux-aarch64, docker_container: "debian:bullseye", name: "Debian 11 Bullseye"}
- {arch: arm64, runs_on: stracle-linux-aarch64, docker_container: "debian:buster", name: "Debian 10 Buster"}
- {arch: arm64, runs_on: stracle-linux-aarch64, docker_container: "ubuntu:20.04", name: "Ubuntu 20.04 LTS Focal"}
- {arch: arm64, runs_on: stracle-linux-aarch64, docker_container: "ubuntu:22.04", name: "Ubuntu 22.04 LTS Jammy"}
runs-on: ${{ matrix.os.runs_on }}
container: ${{ matrix.os.docker_container }}
steps:
- name: OS information
run: |
exec 2>&1
set -x
cat /etc/lsb-release || :
cat /etc/os-release || :
cat /etc/system-release || :
uname -a || :
- name: update apt
run: apt-get update
# Node.js 20 is required by actions/download-artifact.
# TODO(strager): Bake this step into the Docker image.
- name: install Node.js 20 on Ubuntu
if: ${{ matrix.os.install_node_20_ubuntu }}
run: |
apt-get install -y curl
curl -sL https://deb.nodesource.com/setup_18.x -o nodesource_setup.sh
bash nodesource_setup.sh
apt-get install -y nodejs
shell: bash
- uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
with:
name: quick-lint-js-deb-${{ matrix.os.arch }}-${{ github.sha }}
- name: install quick-lint-js
run: dpkg -i quick-lint-js_*.deb
- name: test quick-lint-js
run: quick-lint-js --version
- name: install quick-lint-js-vim dependencies
run: DEBIAN_FRONTEND=noninteractive apt-get install -y vim vim-addon-manager
- name: install quick-lint-js-vim
run: dpkg -i quick-lint-js-vim_*.deb
# quick-lint-js finds bugs in JavaScript programs.
# Copyright (C) 2020 Matthew Glazar
#
# This file is part of quick-lint-js.
#
# quick-lint-js is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# quick-lint-js is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with quick-lint-js. If not, see <https://www.gnu.org/licenses/>.