diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 534b2321..a9509bce 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -18,14 +18,10 @@ jobs: permissions: contents: read packages: write - id-token: write steps: - uses: actions/checkout@v5 - - name: Install cosign - uses: sigstore/cosign-installer@v3 - - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 @@ -44,62 +40,61 @@ jobs: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - # Compute tags for the image - name: Compute version tags id: compute run: | 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="" - if [[ -n "$INPUT" ]]; then - VERSION="${INPUT#v}" # strip leading v + if [[ -n "$VERSION" ]]; then MAJOR=$(echo "$VERSION" | cut -d. -f1) MINOR=$(echo "$VERSION" | cut -d. -f2) - # prereleases (e.g., 3.0.0-beta) do NOT get 'latest' if [[ "$VERSION" == *-* ]]; then - TAGS="${VERSION}" + # prerelease: only version tag + TAGS="$VERSION" else - TAGS="${VERSION},${MAJOR}.${MINOR},${MAJOR},latest" + # stable release: version + hierarchy + latest + TAGS="$VERSION,${MAJOR}.${MINOR},${MAJOR},postgresql-latest,latest" fi + else + # Non-tag build (e.g. from main branch) + TAGS="${REF_NAME}" fi echo "tags=$TAGS" >> $GITHUB_OUTPUT 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 - 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: | - cosign attest --yes \ - --predicate <(echo '{"build":"github-actions","repo":"${{ github.repository }}","run_id":"${{ github.run_id }}"}') \ - --type slsaprovenance \ - ${{ steps.meta.outputs.tags }} + TAGS="${{ steps.compute.outputs.tags }}" + + # Set image targets conditionally + 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 diff --git a/.gitignore b/.gitignore index a1be2e9b..19be04c4 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ node_modules .pnp .pnp.js .pnpm-store +package-lock.json # testing /coverage diff --git a/README.md b/README.md index 2d1ea62e..5776c86e 100644 --- a/README.md +++ b/README.md @@ -95,6 +95,11 @@ docker pull docker.umami.is/umami-software/umami:latest --- ## 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: diff --git a/src/components/input/DownloadButton.tsx b/src/components/input/DownloadButton.tsx index 795db8dc..9fd46c0b 100644 --- a/src/components/input/DownloadButton.tsx +++ b/src/components/input/DownloadButton.tsx @@ -19,7 +19,7 @@ export function DownloadButton({ return ( -