FossilRepo
Add release archives: tarball + zip with vendored deps on GitHub Releases
Commit
41e2187a0834be7e51d2ee2f765e7da2ccc4010b1d5753037591ae8915bfa6d2
Parent
a16e2e9cd179da0…
1 file changed
+58
-1
+58
-1
| --- .github/workflows/publish.yaml | ||
| +++ .github/workflows/publish.yaml | ||
| @@ -3,11 +3,11 @@ | ||
| 3 | 3 | on: |
| 4 | 4 | release: |
| 5 | 5 | types: [published] |
| 6 | 6 | |
| 7 | 7 | permissions: |
| 8 | - contents: read | |
| 8 | + contents: write | |
| 9 | 9 | |
| 10 | 10 | jobs: |
| 11 | 11 | pypi: |
| 12 | 12 | name: Publish to PyPI |
| 13 | 13 | runs-on: ubuntu-latest |
| @@ -29,10 +29,67 @@ | ||
| 29 | 29 | run: python -m build |
| 30 | 30 | |
| 31 | 31 | - name: Publish to PyPI |
| 32 | 32 | uses: pypa/gh-action-pypi-publish@release/v1 |
| 33 | 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 | + | |
| 34 | 91 | docker: |
| 35 | 92 | name: Publish to Docker Hub |
| 36 | 93 | runs-on: ubuntu-latest |
| 37 | 94 | |
| 38 | 95 | steps: |
| 39 | 96 |
| --- .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 |