Skip to content

Commit bb15c15

Browse files
committed
Add a workflow to initialize the branches
The idea is that branches (whose name reflect the targeted CPU architecture) hold the respective state of the Pacman repository. Currently, Git for Windows' Pacman repository is hosted on Azure Blobs, in my personal Azure account. This is not ideal, an open source maintainer should always be ready to step away. So let's download the files that are currently referenced by the database at Git for Windows' repository, initialize these branches, to test whether we could easily switch to using [git-for-windows] Server = https://github.com/git-for-windows/pacman-repo/raw/refs/heads/x86_64 instead of [git-for-windows] Server = https://wingit.blob.core.windows.net/x86-64 Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
0 parents  commit bb15c15

File tree

1 file changed

+72
-0
lines changed

1 file changed

+72
-0
lines changed
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: Initialize branches
2+
3+
on: [push]
4+
5+
jobs:
6+
initialize:
7+
runs-on: ubuntu-latest
8+
permissions:
9+
contents: write
10+
steps:
11+
- uses: actions/checkout@v4
12+
- name: initialize {x86_64,aarch64,i686} branches
13+
run: |
14+
set -ex
15+
16+
for arch in x86_64 aarch64 i686
17+
do
18+
git switch --orphan $arch
19+
20+
base_url=https://wingit.blob.core.windows.net/$arch
21+
case "$arch" in
22+
x86_64)
23+
base_url=https://wingit.blob.core.windows.net/x86-64
24+
msystem=mingw64
25+
;;
26+
aarch64)
27+
msystem=clangarm64
28+
;;
29+
i686)
30+
msystem=mingw32
31+
;;
32+
esac
33+
34+
date="$(curl --head $base_url/git-for-windows.db |sed -n 's/^Last-Modified: //ip')"
35+
test -n "$date" || exit 1
36+
37+
for suffix in '' "-$msystem"
38+
do
39+
for infix in db files
40+
do
41+
for ext in '' .tar.xz
42+
do
43+
for sig in '' .sig
44+
do
45+
name=git-for-windows$suffix.$infix$ext$sig
46+
echo "::notice::Downloading $name"
47+
curl -fLo $name $base_url/$name &&
48+
git add $name || exit 1
49+
done
50+
done
51+
done
52+
done
53+
54+
for package in $(tar --wildcards -Oxvf git-for-windows.db \*/desc 2>&1 |
55+
sed -n '/%FILENAME%/{n;p}')
56+
do
57+
for sig in '' .sig
58+
do
59+
name=$package$sig
60+
echo "::notice::Downloading $name"
61+
curl -fLo $name $base_url/$name &&
62+
git add $name || exit 1
63+
done
64+
done
65+
66+
git \
67+
-c user.name='${{ github.actor }}' \
68+
-c user.email='${{ github.actor }}@users.noreply.github.com' \
69+
commit -m "Initialize $arch" --date="$date" || exit 1
70+
71+
git push origin HEAD || exit 1
72+
done

0 commit comments

Comments
 (0)