Skip to content

Commit

Permalink
feat(cli): auto-release (#10127)
Browse files Browse the repository at this point in the history
  • Loading branch information
jrasm91 authored Jun 11, 2024
1 parent eba166a commit 7354555
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
23 changes: 12 additions & 11 deletions .github/workflows/cli.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
name: CLI Build
on:
workflow_dispatch:
push:
branches: [main]
paths:
- "cli/**"
- ".github/workflows/cli.yml"
- 'cli/**'
- '.github/workflows/cli.yml'
pull_request:
branches: [main]
paths:
- "cli/**"
- ".github/workflows/cli.yml"
- 'cli/**'
- '.github/workflows/cli.yml'
release:
types: [published]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand All @@ -32,16 +33,16 @@ jobs:
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@v4
with:
node-version: "20.x"
registry-url: "https://registry.npmjs.org"
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'
- name: Prepare 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 run build
- run: npm publish
if: ${{ github.event_name == 'workflow_dispatch' }}
if: ${{ github.event_name == 'release' }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

Expand Down Expand Up @@ -83,15 +84,15 @@ jobs:
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' }}
type=raw,value=${{ steps.package-version.outputs.version }},enable=${{ github.event_name == 'release' }}
type=raw,value=latest,enable=${{ github.event_name == 'release' }}
- name: Build and push image
uses: docker/[email protected]
with:
file: cli/Dockerfile
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name == 'workflow_dispatch' }}
push: ${{ github.event_name == 'release' }}
cache-from: type=gha
cache-to: type=gha,mode=max
tags: ${{ steps.metadata.outputs.tags }}
Expand Down
6 changes: 4 additions & 2 deletions misc/release/pump-version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,12 @@ if [ "$CURRENT_SERVER" != "$NEXT_SERVER" ]; then
npm --prefix server run build
make open-api
npm --prefix open-api/typescript-sdk version "$SERVER_PUMP"
# TODO use $SERVER_PUMP once we pass 2.2.x
npm --prefix cli version patch
npm --prefix cli i --package-lock-only
npm --prefix web version "$SERVER_PUMP"
npm --prefix e2e version "$SERVER_PUMP"
npm --prefix web i --package-lock-only
npm --prefix cli i --package-lock-only
npm --prefix e2e version "$SERVER_PUMP"
npm --prefix e2e i --package-lock-only
poetry --directory machine-learning version "$SERVER_PUMP"
fi
Expand Down

2 comments on commit 7354555

@Rajeshvarma2001
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hi

@Rajeshvarma2001
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's talk about react js

Please sign in to comment.