From aa143c4c947a2e1c5a0ee1250729ddaa21d1486a Mon Sep 17 00:00:00 2001 From: Jonathan Jogenfors Date: Fri, 9 Feb 2024 00:14:57 +0100 Subject: [PATCH 1/8] fix cli path --- cli/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cli/package.json b/cli/package.json index 2f9d436d749b4..4a9b21e09cae5 100644 --- a/cli/package.json +++ b/cli/package.json @@ -5,7 +5,7 @@ "type": "module", "exports": "./dist/index.js", "bin": { - "immich": "./dist/index.js" + "immich": "dist/index.js" }, "license": "MIT", "keywords": [ @@ -51,7 +51,7 @@ }, "repository": { "type": "git", - "url": "github:immich-app/immich", + "url": "git+https://github.com/immich-app/immich.git", "directory": "cli" }, "engines": { From e2a6db464230bc6ed00c5142f29533ab8d4620ae Mon Sep 17 00:00:00 2001 From: Jonathan Jogenfors Date: Fri, 9 Feb 2024 00:58:28 +0100 Subject: [PATCH 2/8] run npm ci in sdk folder --- .github/workflows/cli.yml | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/workflows/cli.yml b/.github/workflows/cli.yml index 57df2bb8a2c1d..3b05b1da0a7f9 100644 --- a/.github/workflows/cli.yml +++ b/.github/workflows/cli.yml @@ -3,14 +3,14 @@ on: workflow_dispatch: push: branches: [main] - paths: - - 'cli/**' - - '.github/workflows/cli.yml' + paths: + - "cli/**" + - ".github/workflows/cli.yml" pull_request: branches: [main] - paths: - - 'cli/**' - - '.github/workflows/cli.yml' + paths: + - "cli/**" + - ".github/workflows/cli.yml" concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -34,6 +34,9 @@ jobs: with: node-version: "20.x" registry-url: "https://registry.npmjs.org" + - name: Prepare SDK + run: npm ci + working-directory: ./open-api/typescript-sdk/ - run: npm ci - run: npm publish if: ${{ github.event_name == 'workflow_dispatch' }} @@ -62,7 +65,7 @@ jobs: registry: ghcr.io username: ${{ github.repository_owner }} password: ${{ secrets.GITHUB_TOKEN }} - + - name: Get package version id: package-version run: | From 2144715fe2064d8e7a50cc681ae6cbe84d428bf1 Mon Sep 17 00:00:00 2001 From: Jonathan Jogenfors Date: Fri, 9 Feb 2024 00:59:25 +0100 Subject: [PATCH 3/8] version bump --- cli/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/package.json b/cli/package.json index 4a9b21e09cae5..679373681b9ba 100644 --- a/cli/package.json +++ b/cli/package.json @@ -1,6 +1,6 @@ { "name": "@immich/cli", - "version": "2.0.7", + "version": "2.0.8", "description": "Command Line Interface (CLI) for Immich", "type": "module", "exports": "./dist/index.js", From 840e2e631f1a1cfc3eff5a884cbe4036bd5bea86 Mon Sep 17 00:00:00 2001 From: Jonathan Jogenfors Date: Fri, 9 Feb 2024 09:05:43 +0100 Subject: [PATCH 4/8] build sdk before publishing cli --- .github/workflows/cli.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cli.yml b/.github/workflows/cli.yml index 3b05b1da0a7f9..f827de7e8ad17 100644 --- a/.github/workflows/cli.yml +++ b/.github/workflows/cli.yml @@ -35,8 +35,9 @@ jobs: node-version: "20.x" registry-url: "https://registry.npmjs.org" - name: Prepare SDK - run: npm ci - working-directory: ./open-api/typescript-sdk/ + run: npm ci --prefix ../open-api/typescript-sdk/ + - name: Build SDK + run: npm run build --prefix ../open-api/typescript-sdk/ - run: npm ci - run: npm publish if: ${{ github.event_name == 'workflow_dispatch' }} From 2c234c5879496bc7f560fe7cbd50588ad0f1a157 Mon Sep 17 00:00:00 2001 From: Jonathan Jogenfors Date: Fri, 9 Feb 2024 09:31:39 +0100 Subject: [PATCH 5/8] dry run publish --- .github/workflows/cli.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cli.yml b/.github/workflows/cli.yml index f827de7e8ad17..49ea536ef8058 100644 --- a/.github/workflows/cli.yml +++ b/.github/workflows/cli.yml @@ -39,7 +39,7 @@ jobs: - name: Build SDK run: npm run build --prefix ../open-api/typescript-sdk/ - run: npm ci - - run: npm publish + - run: npm publish --dry-run if: ${{ github.event_name == 'workflow_dispatch' }} env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} From cbc8473944ae62e4f614b0df74c64cf1bab2d0f8 Mon Sep 17 00:00:00 2001 From: Jonathan Jogenfors Date: Fri, 9 Feb 2024 09:33:43 +0100 Subject: [PATCH 6/8] build cli --- .github/workflows/cli.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/cli.yml b/.github/workflows/cli.yml index 49ea536ef8058..7352711f9e894 100644 --- a/.github/workflows/cli.yml +++ b/.github/workflows/cli.yml @@ -39,6 +39,7 @@ jobs: - name: Build SDK run: npm run build --prefix ../open-api/typescript-sdk/ - run: npm ci + - run: npm run build - run: npm publish --dry-run if: ${{ github.event_name == 'workflow_dispatch' }} env: From 2652bae7255ede7f5b7544f306ab74b2de425f86 Mon Sep 17 00:00:00 2001 From: bo0tzz Date: Fri, 9 Feb 2024 09:41:59 +0100 Subject: [PATCH 7/8] fix(ci): Push CLI latest tag --- .github/workflows/cli.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/cli.yml b/.github/workflows/cli.yml index 49ea536ef8058..c6713fe863933 100644 --- a/.github/workflows/cli.yml +++ b/.github/workflows/cli.yml @@ -77,10 +77,13 @@ jobs: id: metadata uses: docker/metadata-action@v5 with: + flavor: | + latest=false images: | name=ghcr.io/${{ github.repository_owner }}/immich-cli tags: | type=raw,value=${{ steps.package-version.outputs.version }},enable=${{ github.event_name == 'workflow_dispatch' }} + type=raw,value=latest,enable=${{ github.event_name == 'workflow_dispatch' }} - name: Build and push image uses: docker/build-push-action@v5.1.0 From df348733a82b3ca329ffa753bd79b233753bc28d Mon Sep 17 00:00:00 2001 From: Jonathan Jogenfors Date: Fri, 9 Feb 2024 11:37:39 +0100 Subject: [PATCH 8/8] remove dry run flag --- .github/workflows/cli.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cli.yml b/.github/workflows/cli.yml index 6364c51d37f8c..87170e5d590b7 100644 --- a/.github/workflows/cli.yml +++ b/.github/workflows/cli.yml @@ -40,7 +40,7 @@ jobs: run: npm run build --prefix ../open-api/typescript-sdk/ - run: npm ci - run: npm run build - - run: npm publish --dry-run + - run: npm publish if: ${{ github.event_name == 'workflow_dispatch' }} env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}