FossilRepo

Add release archives: tarball + zip with vendored deps on GitHub Releases

lmata 2026-04-07 16:36 trunk
Commit 41e2187a0834be7e51d2ee2f765e7da2ccc4010b1d5753037591ae8915bfa6d2
--- .github/workflows/publish.yaml
+++ .github/workflows/publish.yaml
@@ -3,11 +3,11 @@
33
on:
44
release:
55
types: [published]
66
77
permissions:
8
- contents: read
8
+ contents: write
99
1010
jobs:
1111
pypi:
1212
name: Publish to PyPI
1313
runs-on: ubuntu-latest
@@ -29,10 +29,67 @@
2929
run: python -m build
3030
3131
- name: Publish to PyPI
3232
uses: pypa/gh-action-pypi-publish@release/v1
3333
34
+ release-assets:
35
+ name: Upload release archives
36
+ runs-on: ubuntu-latest
37
+ permissions:
38
+ contents: write
39
+
40
+ steps:
41
+ - uses: actions/checkout@v4
42
+
43
+ - uses: actions/setup-python@v5
44
+ with:
45
+ python-version: "3.12"
46
+
47
+ - name: Extract version
48
+ id: version
49
+ run: echo "tag=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT"
50
+
51
+ - name: Build release tarball and zip
52
+ run: |
53
+ VERSION="${{ steps.version.outputs.tag }}"
54
+
55
+ # Download Python deps into vendor/
56
+ pip download -r <(python -c "
57
+ import tomllib
58
+ with open('pyproject.toml', 'rb') as f:
59
+ d = tomllib.load(f)
60
+ print('\n'.join(d['project'].get('dependencies', [])))
61
+ ") -d vendor/
62
+
63
+ # Create archives with source + install.sh + vendored deps
64
+ tar czf "fossilrepo-${VERSION}.tar.gz" \
65
+ --transform "s,^,fossilrepo-${VERSION}/," \
66
+ --exclude='.git' \
67
+ --exclude='__pycache__' \
68
+ --exclude='*.pyc' \
69
+ --exclude='.ruff_cache' \
70
+ --exclude='node_modules' \
71
+ --exclude='assets' \
72
+ .
73
+
74
+ # Zip version
75
+ mkdir -p "/tmp/fossilrepo-${VERSION}"
76
+ rsync -a --exclude='.git' --exclude='__pycache__' --exclude='*.pyc' \
77
+ --exclude='.ruff_cache' --exclude='node_modules' --exclude='assets' \
78
+ . "/tmp/fossilrepo-${VERSION}/"
79
+ cd /tmp && zip -qr "$GITHUB_WORKSPACE/fossilrepo-${VERSION}.zip" "fossilrepo-${VERSION}"
80
+
81
+ - name: Upload to GitHub Release
82
+ env:
83
+ GH_TOKEN: ${{ github.token }}
84
+ run: |
85
+ VERSION="${{ steps.version.outputs.tag }}"
86
+ gh release upload "${{ github.ref_name }}" \
87
+ "fossilrepo-${VERSION}.tar.gz" \
88
+ "fossilrepo-${VERSION}.zip" \
89
+ --clobber
90
+
3491
docker:
3592
name: Publish to Docker Hub
3693
runs-on: ubuntu-latest
3794
3895
steps:
3996
--- .github/workflows/publish.yaml
+++ .github/workflows/publish.yaml
@@ -3,11 +3,11 @@
3 on:
4 release:
5 types: [published]
6
7 permissions:
8 contents: read
9
10 jobs:
11 pypi:
12 name: Publish to PyPI
13 runs-on: ubuntu-latest
@@ -29,10 +29,67 @@
29 run: python -m build
30
31 - name: Publish to PyPI
32 uses: pypa/gh-action-pypi-publish@release/v1
33
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
34 docker:
35 name: Publish to Docker Hub
36 runs-on: ubuntu-latest
37
38 steps:
39
--- .github/workflows/publish.yaml
+++ .github/workflows/publish.yaml
@@ -3,11 +3,11 @@
3 on:
4 release:
5 types: [published]
6
7 permissions:
8 contents: write
9
10 jobs:
11 pypi:
12 name: Publish to PyPI
13 runs-on: ubuntu-latest
@@ -29,10 +29,67 @@
29 run: python -m build
30
31 - name: Publish to PyPI
32 uses: pypa/gh-action-pypi-publish@release/v1
33
34 release-assets:
35 name: Upload release archives
36 runs-on: ubuntu-latest
37 permissions:
38 contents: write
39
40 steps:
41 - uses: actions/checkout@v4
42
43 - uses: actions/setup-python@v5
44 with:
45 python-version: "3.12"
46
47 - name: Extract version
48 id: version
49 run: echo "tag=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT"
50
51 - name: Build release tarball and zip
52 run: |
53 VERSION="${{ steps.version.outputs.tag }}"
54
55 # Download Python deps into vendor/
56 pip download -r <(python -c "
57 import tomllib
58 with open('pyproject.toml', 'rb') as f:
59 d = tomllib.load(f)
60 print('\n'.join(d['project'].get('dependencies', [])))
61 ") -d vendor/
62
63 # Create archives with source + install.sh + vendored deps
64 tar czf "fossilrepo-${VERSION}.tar.gz" \
65 --transform "s,^,fossilrepo-${VERSION}/," \
66 --exclude='.git' \
67 --exclude='__pycache__' \
68 --exclude='*.pyc' \
69 --exclude='.ruff_cache' \
70 --exclude='node_modules' \
71 --exclude='assets' \
72 .
73
74 # Zip version
75 mkdir -p "/tmp/fossilrepo-${VERSION}"
76 rsync -a --exclude='.git' --exclude='__pycache__' --exclude='*.pyc' \
77 --exclude='.ruff_cache' --exclude='node_modules' --exclude='assets' \
78 . "/tmp/fossilrepo-${VERSION}/"
79 cd /tmp && zip -qr "$GITHUB_WORKSPACE/fossilrepo-${VERSION}.zip" "fossilrepo-${VERSION}"
80
81 - name: Upload to GitHub Release
82 env:
83 GH_TOKEN: ${{ github.token }}
84 run: |
85 VERSION="${{ steps.version.outputs.tag }}"
86 gh release upload "${{ github.ref_name }}" \
87 "fossilrepo-${VERSION}.tar.gz" \
88 "fossilrepo-${VERSION}.zip" \
89 --clobber
90
91 docker:
92 name: Publish to Docker Hub
93 runs-on: ubuntu-latest
94
95 steps:
96

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button