Skip to content

Commit

Permalink
build vim with Docker and publish binaries
Browse files Browse the repository at this point in the history
  • Loading branch information
heywoodlh committed Jun 19, 2023
1 parent ee83319 commit 10703ac
Show file tree
Hide file tree
Showing 4 changed files with 81 additions and 1 deletion.
Empty file removed .github/workflows/darwin-build.yml
Empty file.
69 changes: 69 additions & 0 deletions .github/workflows/linux-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: vim-build

on:
schedule:
- cron: "45 5 * * Sun"
workflow_dispatch:

jobs:
docker:
runs-on: ubuntu-latest
steps:
-
name: clone https://github.com/heywoodlh/vim-builds
uses: actions/checkout@master
with:
name: heywoodlh/vim-builds
repository: heywoodlh/vim-builds
path: ./vim-builds

-
name: Set up QEMU
uses: docker/setup-qemu-action@v2

-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

-
name: Build vim-builds amd64 container
uses: docker/build-push-action@v4
with:
context: ./vim-builds
file: ./vim-builds/Dockerfile
platforms: linux/amd64
tags: heywoodlh/vim-builds-x86_64:latest
load: true

-
name: Build vim-builds arm64 container
uses: docker/build-push-action@v4
with:
context: ./vim-builds
file: ./vim-builds/Dockerfile
platforms: linux/arm64
tags: heywoodlh/vim-builds-arm64:latest
load: true

-
name: Copy vim binaries from vim-builds container
run: |
# Copy vim binaries
amd64_id=$(docker create --platform=linux/amd64 heywoodlh/vim-builds-x86_64)
arm64_id=$(docker create --platform=linux/arm64 heywoodlh/vim-builds-arm64)
docker cp ${amd64_id}:/out/vim-x86_64 vim-x86_64
docker cp ${arm64_id}:/out/vim-aarch64 vim-arm64
docker rm -f ${amd64_id}
docker rm -f ${arm64_id}
# Get version
export VIM_VERSION=$(./vim-x86_64 --version | head -1 | cut -d'(' -f1 | awk '{print $NF}')
echo VIM_VERSION=${VIM_VERSION} >> $GITHUB_ENV
# Remove vim-builds directory
rm -rf vim-builds
-
name: Create release using compiled vim binaries
uses: ncipollo/release-action@v1
with:
tag: ${{ env.VIM_VERSION }}
artifacts: 'vim-*'
11 changes: 11 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM alpine

RUN apk add --no-cache gcc make musl-dev ncurses-static git \
&& git clone https://github.com/vim/vim /opt/vim \
&& cd /opt/vim \
&& LDFLAGS="-static" ./configure --disable-channel --disable-gpm --disable-gtktest --disable-gui --disable-netbeans --disable-nls --disable-selinux --disable-smack --disable-sysmouse --disable-xsmp --enable-multibyte --with-features=huge --without-x --with-tlib=ncursesw \
&& make \
&& make install \
&& mkdir -p /out/ \
&& cp /usr/local/bin/vim /out/vim-$(arch) \
&& chown -R $(id -u):$(id -g) /out/vim-$(arch)
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Statically linked, cross-platform and cross-architecture Vim binaries for MacOS and Linux built with GitHub Actions.
Statically linked, cross-architecture Vim binaries for Linux built with GitHub Actions.

0 comments on commit 10703ac

Please sign in to comment.