File tree Expand file tree Collapse file tree 13 files changed +75
-48
lines changed
Expand file tree Collapse file tree 13 files changed +75
-48
lines changed Original file line number Diff line number Diff line change 11name : check-branches
2-
32on :
43 - pull_request
54
87 name : Shellcheck
98 runs-on : ubuntu-20.04
109 steps :
11- - uses : actions/checkout@v2
12- - name : Run ShellCheck
10+ - name : Checkout the repo
11+ uses : actions/checkout@v2
12+ - name : Lint Bash scripts
1313 uses : ludeeus/action-shellcheck@master
14+ env :
15+ SHELLCHECK_OPTS : -x
16+ with :
17+ scandir : " ./scripts"
18+ - name : Lint Dockerfile
19+ uses : brpaz/hadolint-action@v1.2.1
1420 with :
15- scandir : " ./ci "
21+ dockerfile : Dockerfile
Original file line number Diff line number Diff line change @@ -20,16 +20,16 @@ jobs:
2020 - name : Checkout the repo
2121 uses : actions/checkout@v2
2222 - name : Check last version
23- run : bash ./ci /check-last-version.bash
23+ run : bash ./scripts /check-last-version.bash
2424 - name : Import environment variables
2525 shell : bash
2626 run : |
2727 while read line; do
2828 echo "$line" >> $GITHUB_ENV
29- done < .env
29+ done < assets/variables
3030 - name : Set env vars
3131 id : var
32- run : . ./ci /set-env-vars.bash
32+ run : . ./scripts /set-env-vars.bash
3333 outputs :
3434 pkg_version : ${{ steps.var.outputs.pkg_version }}
3535
@@ -49,11 +49,11 @@ jobs:
4949 run : |
5050 while read line; do
5151 echo "$line" >> $GITHUB_ENV
52- done < .env
52+ done < assets/variables
5353 - name : Patch glibc
54- run : bash ./ci /patch-glibc.bash
54+ run : bash ./scripts /patch-glibc.bash
5555 - name : Build artifacts
56- run : bash ./ci /build-artifacts.bash
56+ run : bash ./scripts /build-artifacts.bash
5757 - name : Create release
5858 id : create_release
5959 uses : actions/create-release@v1
7979 env :
8080 PRIV_KEY : ${{ secrets.PRIV_KEY }}
8181 PUB_KEY : ${{ secrets.PUB_KEY }}
82- run : bash ./ci /push-to-aur.bash
82+ run : bash ./scripts /push-to-aur.bash
Original file line number Diff line number Diff line change @@ -20,16 +20,16 @@ jobs:
2020 - name : Checkout the repo
2121 uses : actions/checkout@v2
2222 - name : Check last version
23- run : bash ./ci /check-last-version.bash
23+ run : bash ./scripts /check-last-version.bash
2424 - name : Import environment variables
2525 shell : bash
2626 run : |
2727 while read line; do
2828 echo "$line" >> $GITHUB_ENV
29- done < .env
29+ done < assets/variables
3030 - name : Set env vars
3131 id : var
32- run : . ./ci /set-env-vars.bash
32+ run : . ./scripts /set-env-vars.bash
3333 outputs :
3434 pkg_version : ${{ steps.var.outputs.pkg_version }}
3535
@@ -49,11 +49,11 @@ jobs:
4949 run : |
5050 while read line; do
5151 echo "$line" >> $GITHUB_ENV
52- done < .env
52+ done < assets/variables
5353 - name : Patch glibc
54- run : bash ./ci /patch-glibc.bash
54+ run : bash ./scripts /patch-glibc.bash
5555 - name : Build artifacts
56- run : bash ./ci /build-artifacts.bash
56+ run : bash ./scripts /build-artifacts.bash
5757 - name : Upload artifacts
5858 uses : actions/upload-artifact@v2
5959 with :
Original file line number Diff line number Diff line change 1414#
1515FROM archlinux:base-devel
1616
17- COPY deps .
18- COPY .env .
17+ ARG UPSTREAM_BRANCH
18+ ARG UPSTREAM_REPO
19+ ARG USR
20+ ARG USR_HOME
1921
2022ENV CC="/usr/bin/clang" \
2123 CXX="/usr/bin/clang++" \
@@ -26,10 +28,12 @@ ENV CC="/usr/bin/clang" \
2628 CFLAGS="-g -flto -fuse-ld=lld" \
2729 CXXFLAGS="-g -flto -fuse-ld=lld"
2830
29- RUN /bin/bash -c "source .env"
31+ COPY assets/ /assets/
32+ COPY scripts/ /scripts/
3033
31- RUN pacman -Syu --noconfirm && \
32- pacman -U --noconfirm libgccjit-10.2.0-2-x86_64.pkg.tar.zst && \
34+ RUN \
35+ pacman -Syu --noconfirm && \
36+ pacman -U --noconfirm /assets/libgccjit-10.2.0-2-x86_64.pkg.tar.zst && \
3337 pacman -S --noconfirm \
3438 # Emacs deps
3539 alsa-lib \
@@ -52,21 +56,24 @@ RUN pacman -Syu --noconfirm && \
5256 expac \
5357 git \
5458 jq \
55- openssh && \
56- groupadd -r pcr && useradd --no-log-init -r -g pcr pcr && \
57- mkdir "$HOME" && \
58- chown -R pcr:pcr "$HOME" && \
59- echo "pcr ALL=(root) NOPASSWD:ALL" > /etc/sudoers.d/user && \
59+ openssh
60+
61+ RUN \
62+ groupadd -r "$USR" && useradd --no-log-init -r -g "$USR" "$USR" && \
63+ mkdir "$USR_HOME" && \
64+ chown -R "$USR" :"$USR" "$USR_HOME" && \
65+ echo "$USR ALL=(root) NOPASSWD:ALL" > /etc/sudoers.d/user && \
6066 chmod 0440 /etc/sudoers.d/user
6167
62- WORKDIR $HOME
68+ WORKDIR $USR_HOME
6369
64- COPY PKGBUILD .
65- COPY pull.bash .
70+ USER $USR
6671
67- RUN chown -R pcr:pcr "$HOME"
68- USER pcr
72+ SHELL ["/bin/bash" , "-c" ]
6973
70- RUN ["./pull.bash" ]
71- RUN makepkg && \
74+ RUN \
75+ cp /scripts/pull.bash . && \
76+ cp /assets/PKGBUILD . && \
77+ ./pull.bash && \
78+ makepkg && \
7279 rm emacs-1-1-x86_64.pkg.tar.zst
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ source=()
1010sha1sums=()
1111
1212build () {
13- cd " $HOME " /emacs
13+ cd " $USR_HOME " /emacs
1414
1515 [[ -x configure ]] || ( ./autogen.sh git && ./autogen.sh autoconf )
1616
@@ -42,7 +42,7 @@ build() {
4242}
4343
4444package () {
45- cd " $HOME " /emacs
45+ cd " $USR_HOME " /emacs
4646
4747 make DESTDIR=" $pkgdir " install
4848
Original file line number Diff line number Diff line change 11AUR_DNS=aur.archlinux.org
22AUR_IP=95.216.144.15
33AUR_PKG=emacs-gcc-wayland-devel-bin
4- HOME = /home/pcr
4+ USR=pcr
5+ USR_HOME=/home/pcr
56PKG_REL=1
67UPSTREAM_API=https://api.github.com/repos/flatwhatson/emacs
78UPSTREAM_BRANCH=pgtk-nativecomp
Original file line number Diff line number Diff line change 22
33set -euxo pipefail
44
5- cd " $HOME "
5+ cd " $USR_HOME "
66
77# Get sources
8- cp " $GITHUB_WORKSPACE " /pull.bash pull.bash
9- cp " $GITHUB_WORKSPACE " /PKGBUILD PKGBUILD
8+ cp " $GITHUB_WORKSPACE " /scripts/ pull.bash pull.bash
9+ cp " $GITHUB_WORKSPACE " /assets/ PKGBUILD PKGBUILD
1010./pull.bash
11- chown -R pcr:pcr emacs
11+ chown -R " $USR " : " $USR " emacs
1212
1313# Create artifacts
14- su pcr -c " makepkg"
14+ su " $USR " -c " makepkg"
1515
1616# Unpack artifacts
1717mkdir out
File renamed without changes.
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ # shellcheck source=assets/variables
4+ source assets/variables
5+
6+ DOCKER_BUILDKIT=1 docker build \
7+ --build-arg UPSTREAM_BRANCH=" $UPSTREAM_BRANCH " \
8+ --build-arg UPSTREAM_REPO=" $UPSTREAM_REPO " \
9+ --build-arg USR=" $USR " \
10+ --build-arg USR_HOME=" $USR_HOME " \
11+ .
File renamed without changes.
You can’t perform that action at this time.
0 commit comments