Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
darkvertex committed Sep 5, 2022
0 parents commit 89c8014
Show file tree
Hide file tree
Showing 5 changed files with 785 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@

name: Compile Git Release

on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+'

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: write
env:
FORCE_COLOR: 1
steps:
- uses: actions/checkout@v3
- name: Download earthly
run: "sudo /bin/sh -c 'wget https://github.com/earthly/earthly/releases/download/v0.6.22/earthly-linux-amd64 -O /usr/local/bin/earthly && chmod +x /usr/local/bin/earthly'"
- name: Compile upstream git release
run: earthly --use-inline-cache --save-inline-cache --strict +build --GIT_VERSION=${{github.ref_name}}
- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: git
path: ./dist/*
if-no-files-found: error
- name: Compress the binaries
run: cd dist && tar -czvf ../git-binaries.linux-64bit.tar.gz *
- name: Release
uses: ncipollo/release-action@v1
with:
artifacts: "git-binaries.linux-64bit.tar.gz"
allowUpdates: true
removeArtifacts: true
artifactErrorsFailBuild: true
body: statically compiled git v${{github.ref_name}} from https://github.com/git/git/releases/tag/v${{github.ref_name}}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/dist
22 changes: 22 additions & 0 deletions Earthfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
VERSION 0.6

FROM alpine

RUN apk add --no-cache \
curl autoconf gcc flex bison make bash cmake libtool musl-dev g++ \
zlib-dev zlib-static \
tcl tk \
tcl-dev gettext

ARG GIT_VERSION

build:
RUN curl -sL https://github.com/git/git/archive/v${GIT_VERSION}.tar.gz -o git_v${GIT_VERSION}.tar.gz
RUN tar zxf git_v${GIT_VERSION}.tar.gz
WORKDIR /git-${GIT_VERSION}

RUN make configure && sed -i 's/qversion/-version/g' configure
RUN ./configure prefix=/dist/git-${GIT_VERSION} LDFLAGS="--static" CFLAGS="${CFLAGS} -static" && cat config.log
RUN make && make install

SAVE ARTIFACT /dist/git-${GIT_VERSION}/bin/* AS LOCAL ./dist/
Loading

0 comments on commit 89c8014

Please sign in to comment.