44 branches : [ main ]
55 pull_request :
66 branches : [ main ]
7+
8+ # 1. ADDED: Permissions to allow creating releases
9+ permissions :
10+ contents : write
11+
712jobs :
813 build :
914 runs-on : ubuntu-latest
1015 steps :
11- # 1) Check out your repo (this will use the default git first, which is fine)
16+ # 1) Check out your repo
1217 - name : Checkout repository
1318 uses : actions/checkout@v4
14- # 2) Install build dependencies needed for Git
19+
20+ # 2) Install build dependencies
1521 - name : Install build dependencies for Git
1622 run : |
1723 sudo apt-get update
@@ -26,26 +32,55 @@ jobs:
2632 libexpat1-dev \
2733 tar \
2834 wget
35+
2936 # 3) Download Git 2.50.1 source tarball
3037 - name : Download Git 2.50.1
3138 run : |
3239 wget https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.50.1.tar.gz
3340 tar -xzf git-2.50.1.tar.gz
41+
3442 # 4) Build and install Git 2.50.1 into /usr/local
3543 - name : Build and install Git 2.50.1
3644 run : |
3745 cd git-2.50.1
3846 make prefix=/usr/local all
3947 sudo make prefix=/usr/local install
48+
4049 # 5) Make sure /usr/local/bin is preferred and show version
41- - name : Use Git 2.50.1 as default
42- shell : bash
50+ - name : Verify Installation
4351 run : |
44- echo “Using git at: $(command -v git)”
52+ export PATH=/usr/local/bin:$PATH
4553 git --version
46- # 6) Your actual build / test step(s) go here
47- - name : Run build
54+
55+ # --- NEW STEPS BELOW ---
56+
57+ # 6) Package the build into a tarball for release
58+ - name : Package Artifacts
4859 run : |
49- # Example commands; replace with your real build
50- git --version
51- echo “Do your build here (npm/yarn/maven/whatever)”
60+ cd git-2.50.1
61+ # Install to a temporary staging folder (DESTDIR) so we can zip just the new files
62+ mkdir -p ../git-release-build
63+ make prefix=/usr/local DESTDIR=$(pwd)/../git-release-build install
64+
65+ # Create the tarball
66+ cd ../git-release-build
67+ tar -czvf ../git-2.50.1-linux-amd64.tar.gz .
68+
69+ # 7) Push to GitHub Releases
70+ - name : Create Release
71+ uses : softprops/action-gh-release@v2
72+ if : startsWith(github.ref, 'refs/tags/') # Only release if a tag is pushed
73+ with :
74+ files : git-2.50.1-linux-amd64.tar.gz
75+
76+ # Optional: If you want a "Nightly" release on every push to main (since you trigger on main)
77+ - name : Update Nightly Release
78+ uses : softprops/action-gh-release@v2
79+ if : github.ref == 'refs/heads/main'
80+ with :
81+ tag_name : nightly-build
82+ name : Nightly Build (Git 2.50.1)
83+ draft : false
84+ prerelease : true
85+ overwrite : true
86+ files : git-2.50.1-linux-amd64.tar.gz
0 commit comments