-
Notifications
You must be signed in to change notification settings - Fork 2
154 lines (131 loc) · 5.15 KB
/
Copy pathbuild-git-filter-repo.yml
File metadata and controls
154 lines (131 loc) · 5.15 KB
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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
# Copyright (c) 2026 Gili Tzabari. All rights reserved.
#
# Licensed under the CAT Commercial License.
# See LICENSE.md in the project root for license terms.
name: Build git-filter-repo Binaries
on:
workflow_dispatch:
inputs:
version:
description: 'git-filter-repo version tag (e.g., v2.38.0)'
required: true
default: 'v2.38.0'
push:
branches:
- 2.1-build-git-filter-repo-ci
paths:
- '.github/workflows/build-git-filter-repo.yml'
jobs:
build:
strategy:
matrix:
include:
- os: ubuntu-latest
platform: linux-x64
- os: ubuntu-24.04-arm
platform: linux-aarch64
- os: macos-latest
platform: macos-x64
- os: macos-latest
platform: macos-aarch64
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install PyInstaller
run: pip install pyinstaller
- name: Download git-filter-repo
run: |
set -euo pipefail
VERSION="${{ github.event.inputs.version }}"
curl -fsSL -o git-filter-repo \
"https://raw.githubusercontent.com/newren/git-filter-repo/${VERSION}/git-filter-repo"
chmod +x git-filter-repo
- name: Build standalone binary with PyInstaller
run: |
set -euo pipefail
pyinstaller \
--onefile \
--name git-filter-repo \
--add-data "git-filter-repo:." \
git-filter-repo
ls -lh dist/git-filter-repo
- name: Verify binary runs
run: |
set -euo pipefail
./dist/git-filter-repo --version
- name: Generate SHA256 checksum
run: |
set -euo pipefail
cd dist
sha256sum git-filter-repo > git-filter-repo-${{ matrix.platform }}.sha256
cat git-filter-repo-${{ matrix.platform }}.sha256
- name: Rename binary for platform
run: |
set -euo pipefail
mv dist/git-filter-repo dist/git-filter-repo-${{ matrix.platform }}
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: git-filter-repo-${{ matrix.platform }}
path: |
dist/git-filter-repo-${{ matrix.platform }}
dist/git-filter-repo-${{ matrix.platform }}.sha256
release:
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
merge-multiple: true
- name: List artifacts
run: ls -la artifacts/
- name: Read SHA256 checksums
id: checksums
run: |
set -euo pipefail
LINUX_X64=$(awk '{print $1}' artifacts/git-filter-repo-linux-x64.sha256)
LINUX_AARCH64=$(awk '{print $1}' artifacts/git-filter-repo-linux-aarch64.sha256)
MACOS_X64=$(awk '{print $1}' artifacts/git-filter-repo-macos-x64.sha256)
MACOS_AARCH64=$(awk '{print $1}' artifacts/git-filter-repo-macos-aarch64.sha256)
echo "linux_x64=${LINUX_X64}" >> $GITHUB_OUTPUT
echo "linux_aarch64=${LINUX_AARCH64}" >> $GITHUB_OUTPUT
echo "macos_x64=${MACOS_X64}" >> $GITHUB_OUTPUT
echo "macos_aarch64=${MACOS_AARCH64}" >> $GITHUB_OUTPUT
- name: Create release
uses: softprops/action-gh-release@v2
with:
tag_name: git-filter-repo-${{ github.event.inputs.version }}
name: git-filter-repo ${{ github.event.inputs.version }} Standalone Binaries
body: |
## git-filter-repo ${{ github.event.inputs.version }} Standalone Binaries
Pre-built standalone binaries of [git-filter-repo](https://github.com/newren/git-filter-repo)
compiled with PyInstaller. No Python installation required.
### Platforms
| Platform | File | SHA256 |
|----------|------|--------|
| Linux x86_64 | `git-filter-repo-linux-x64` | `${{ steps.checksums.outputs.linux_x64 }}` |
| Linux ARM64 | `git-filter-repo-linux-aarch64` | `${{ steps.checksums.outputs.linux_aarch64 }}` |
| macOS Intel | `git-filter-repo-macos-x64` | `${{ steps.checksums.outputs.macos_x64 }}` |
| macOS Apple Silicon | `git-filter-repo-macos-aarch64` | `${{ steps.checksums.outputs.macos_aarch64 }}` |
### Usage
The CAT plugin automatically downloads the appropriate binary on first use.
Set `GFR_FORCE_DOWNLOAD=1` to force re-download and re-verification.
files: |
artifacts/git-filter-repo-linux-x64
artifacts/git-filter-repo-linux-aarch64
artifacts/git-filter-repo-macos-x64
artifacts/git-filter-repo-macos-aarch64
artifacts/git-filter-repo-linux-x64.sha256
artifacts/git-filter-repo-linux-aarch64.sha256
artifacts/git-filter-repo-macos-x64.sha256
artifacts/git-filter-repo-macos-aarch64.sha256
draft: false
prerelease: false