mirror of
https://github.com/umami-software/umami.git
synced 2025-12-06 01:18:00 +01:00
Merge branch 'master' into dev
This commit is contained in:
commit
9e6e779b29
4 changed files with 46 additions and 45 deletions
83
.github/workflows/cd.yml
vendored
83
.github/workflows/cd.yml
vendored
|
|
@ -18,14 +18,10 @@ jobs:
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
packages: write
|
packages: write
|
||||||
id-token: write
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v5
|
||||||
|
|
||||||
- name: Install cosign
|
|
||||||
uses: sigstore/cosign-installer@v3
|
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
|
|
@ -44,62 +40,61 @@ jobs:
|
||||||
username: ${{ secrets.DOCKER_USERNAME }}
|
username: ${{ secrets.DOCKER_USERNAME }}
|
||||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||||
|
|
||||||
# Compute tags for the image
|
|
||||||
- name: Compute version tags
|
- name: Compute version tags
|
||||||
id: compute
|
id: compute
|
||||||
run: |
|
run: |
|
||||||
INPUT="${{ github.event.inputs.version }}"
|
INPUT="${{ github.event.inputs.version }}"
|
||||||
|
REF_TYPE="${{ github.ref_type }}"
|
||||||
|
REF_NAME="${{ github.ref_name }}"
|
||||||
|
|
||||||
|
# Determine version source
|
||||||
|
if [[ -n "$INPUT" ]]; then
|
||||||
|
VERSION="${INPUT#v}"
|
||||||
|
elif [[ "$REF_TYPE" == "tag" ]]; then
|
||||||
|
VERSION="${REF_NAME#v}"
|
||||||
|
else
|
||||||
|
VERSION=""
|
||||||
|
fi
|
||||||
|
|
||||||
TAGS=""
|
TAGS=""
|
||||||
|
|
||||||
if [[ -n "$INPUT" ]]; then
|
if [[ -n "$VERSION" ]]; then
|
||||||
VERSION="${INPUT#v}" # strip leading v
|
|
||||||
MAJOR=$(echo "$VERSION" | cut -d. -f1)
|
MAJOR=$(echo "$VERSION" | cut -d. -f1)
|
||||||
MINOR=$(echo "$VERSION" | cut -d. -f2)
|
MINOR=$(echo "$VERSION" | cut -d. -f2)
|
||||||
|
|
||||||
# prereleases (e.g., 3.0.0-beta) do NOT get 'latest'
|
|
||||||
if [[ "$VERSION" == *-* ]]; then
|
if [[ "$VERSION" == *-* ]]; then
|
||||||
TAGS="${VERSION}"
|
# prerelease: only version tag
|
||||||
|
TAGS="$VERSION"
|
||||||
else
|
else
|
||||||
TAGS="${VERSION},${MAJOR}.${MINOR},${MAJOR},latest"
|
# stable release: version + hierarchy + latest
|
||||||
|
TAGS="$VERSION,${MAJOR}.${MINOR},${MAJOR},postgresql-latest,latest"
|
||||||
fi
|
fi
|
||||||
|
else
|
||||||
|
# Non-tag build (e.g. from main branch)
|
||||||
|
TAGS="${REF_NAME}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "tags=$TAGS" >> $GITHUB_OUTPUT
|
echo "tags=$TAGS" >> $GITHUB_OUTPUT
|
||||||
echo "Computed tags: $TAGS"
|
echo "Computed tags: $TAGS"
|
||||||
|
|
||||||
- name: Extract Docker metadata
|
|
||||||
id: meta
|
|
||||||
uses: docker/metadata-action@v5
|
|
||||||
with:
|
|
||||||
images: |
|
|
||||||
umamisoftware/umami,enable=${{ github.repository == 'umami-software/umami' }}
|
|
||||||
ghcr.io/${{ github.repository }}
|
|
||||||
tags: |
|
|
||||||
type=semver,pattern={{version}},enable=${{ github.ref_type == 'tag' }}
|
|
||||||
type=semver,pattern={{major}}.{{minor}},enable=${{ github.ref_type == 'tag' }}
|
|
||||||
type=semver,pattern={{major}},enable=${{ github.ref_type == 'tag' }}
|
|
||||||
type=raw,value=${{ steps.compute.outputs.tags }},enable=${{ steps.compute.outputs.tags != '' }}
|
|
||||||
type=ref,event=branch
|
|
||||||
type=sha
|
|
||||||
|
|
||||||
# Build and push images
|
|
||||||
- name: Build and push Docker image
|
- name: Build and push Docker image
|
||||||
id: build-and-push
|
|
||||||
uses: docker/build-push-action@v6
|
|
||||||
with:
|
|
||||||
context: .
|
|
||||||
push: true
|
|
||||||
platforms: linux/amd64,linux/arm64
|
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
|
||||||
cache-from: type=gha
|
|
||||||
cache-to: type=gha,mode=max
|
|
||||||
provenance: false # disable automatic registry attestations
|
|
||||||
|
|
||||||
# Generate a local provenance attestation (not uploaded)
|
|
||||||
- name: Generate local provenance attestation
|
|
||||||
run: |
|
run: |
|
||||||
cosign attest --yes \
|
TAGS="${{ steps.compute.outputs.tags }}"
|
||||||
--predicate <(echo '{"build":"github-actions","repo":"${{ github.repository }}","run_id":"${{ github.run_id }}"}') \
|
|
||||||
--type slsaprovenance \
|
# Set image targets conditionally
|
||||||
${{ steps.meta.outputs.tags }}
|
if [[ "${{ github.repository }}" == "umami-software/umami" ]]; then
|
||||||
|
IMAGES=("umamisoftware/umami" "ghcr.io/${{ github.repository }}")
|
||||||
|
else
|
||||||
|
IMAGES=("ghcr.io/${{ github.repository }}")
|
||||||
|
fi
|
||||||
|
|
||||||
|
for IMAGE in "${IMAGES[@]}"; do
|
||||||
|
echo "Building and pushing $IMAGE with tags: $TAGS"
|
||||||
|
docker buildx build \
|
||||||
|
--platform linux/amd64,linux/arm64 \
|
||||||
|
--push \
|
||||||
|
$(echo "$TAGS" | tr ',' '\n' | sed "s|^|--tag ${IMAGE}:|") \
|
||||||
|
--cache-from type=gha \
|
||||||
|
--cache-to type=gha,mode=max \
|
||||||
|
.
|
||||||
|
done
|
||||||
|
|
|
||||||
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -5,6 +5,7 @@ node_modules
|
||||||
.pnp
|
.pnp
|
||||||
.pnp.js
|
.pnp.js
|
||||||
.pnpm-store
|
.pnpm-store
|
||||||
|
package-lock.json
|
||||||
|
|
||||||
# testing
|
# testing
|
||||||
/coverage
|
/coverage
|
||||||
|
|
|
||||||
|
|
@ -95,6 +95,11 @@ docker pull docker.umami.is/umami-software/umami:latest
|
||||||
---
|
---
|
||||||
|
|
||||||
## Getting Updates
|
## Getting Updates
|
||||||
|
=======
|
||||||
|
## 🔄 Getting Updates
|
||||||
|
> [!WARNING]
|
||||||
|
> If you are updating from Umami V2, image "postgresql-latest" is deprecated. You must change it to "latest".
|
||||||
|
> e.g., rename `docker.umami.is/umami-software/umami:postgresql-latest` to `docker.umami.is/umami-software/umami:latest`.
|
||||||
|
|
||||||
To get the latest features, simply do a pull, install any new dependencies, and rebuild:
|
To get the latest features, simply do a pull, install any new dependencies, and rebuild:
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ export function DownloadButton({
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<TooltipTrigger delay={0}>
|
<TooltipTrigger delay={0}>
|
||||||
<Button variant="quiet" onClick={handleClick} isDisabled={!data}>
|
<Button variant="quiet" onClick={handleClick} isDisabled={!data || data.length === 0}>
|
||||||
<Icon>
|
<Icon>
|
||||||
<Download />
|
<Download />
|
||||||
</Icon>
|
</Icon>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue