mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-09 13:25:11 +00:00
Make release/1.x a privileged branch to run workflows, create releases
It'll work similar to the master branch but with pre-1x and latest-1x tagged series of docker images. This should ease deployment changes from 1.x vs 2.x series
This commit is contained in:
2
.github/workflows/build_khoj_el.yml
vendored
2
.github/workflows/build_khoj_el.yml
vendored
@@ -6,12 +6,14 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- 'master'
|
- 'master'
|
||||||
|
- 'release/1.x'
|
||||||
paths:
|
paths:
|
||||||
- src/interface/emacs/*.el
|
- src/interface/emacs/*.el
|
||||||
- .github/workflows/build_khoj_el.yml
|
- .github/workflows/build_khoj_el.yml
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
- 'master'
|
- 'master'
|
||||||
|
- 'release/1.x'
|
||||||
paths:
|
paths:
|
||||||
- src/interface/emacs/*.el
|
- src/interface/emacs/*.el
|
||||||
- .github/workflows/build_khoj_el.yml
|
- .github/workflows/build_khoj_el.yml
|
||||||
|
|||||||
1
.github/workflows/desktop.yml
vendored
1
.github/workflows/desktop.yml
vendored
@@ -6,6 +6,7 @@ on:
|
|||||||
- "*"
|
- "*"
|
||||||
branches:
|
branches:
|
||||||
- 'master'
|
- 'master'
|
||||||
|
- 'release/1.x'
|
||||||
paths:
|
paths:
|
||||||
- src/interface/desktop/**
|
- src/interface/desktop/**
|
||||||
- .github/workflows/desktop.yml
|
- .github/workflows/desktop.yml
|
||||||
|
|||||||
23
.github/workflows/dockerize.yml
vendored
23
.github/workflows/dockerize.yml
vendored
@@ -6,6 +6,7 @@ on:
|
|||||||
- "*"
|
- "*"
|
||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
|
- release/1.x
|
||||||
paths:
|
paths:
|
||||||
- src/khoj/**
|
- src/khoj/**
|
||||||
- src/interface/web/**
|
- src/interface/web/**
|
||||||
@@ -37,8 +38,8 @@ env:
|
|||||||
# Tag Image with tag name on release
|
# Tag Image with tag name on release
|
||||||
# else with user specified tag (default 'dev') if triggered via workflow
|
# else with user specified tag (default 'dev') if triggered via workflow
|
||||||
# else with run_id if triggered via a pull request
|
# else with run_id if triggered via a pull request
|
||||||
# else with 'pre' (if push to master)
|
# else with 'pre' (if push to master) or 'pre-1x' (if push to release/1.x)
|
||||||
DOCKER_IMAGE_TAG: ${{ github.ref_type == 'tag' && github.ref_name || github.event_name == 'workflow_dispatch' && github.event.inputs.tag || 'pre' }}
|
DOCKER_IMAGE_TAG: ${{ github.ref_type == 'tag' && github.ref_name || github.event_name == 'workflow_dispatch' && github.event.inputs.tag || github.ref_name == 'release/1.x' && 'pre-1x' || 'pre' }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
@@ -153,18 +154,32 @@ jobs:
|
|||||||
- name: Create and Push Local Manifest
|
- name: Create and Push Local Manifest
|
||||||
if: github.event.inputs.khoj == 'true' || github.event_name == 'push'
|
if: github.event.inputs.khoj == 'true' || github.event_name == 'push'
|
||||||
run: |
|
run: |
|
||||||
|
# Only put "latest.*" tag on stable releases (i.e 1.x, 2.x+)
|
||||||
|
if [[ "${{ env.DOCKER_IMAGE_TAG }}" =~ ^[1-9]\.[0-9]+\.[0-9]+$ ]]; then
|
||||||
|
LATEST_TAG="latest"
|
||||||
|
else
|
||||||
|
LATEST_TAG="${{ env.DOCKER_IMAGE_TAG }}"
|
||||||
|
fi
|
||||||
|
|
||||||
docker buildx imagetools create \
|
docker buildx imagetools create \
|
||||||
-t ghcr.io/${{ github.repository }}:${{ env.DOCKER_IMAGE_TAG }} \
|
-t ghcr.io/${{ github.repository }}:${{ env.DOCKER_IMAGE_TAG }} \
|
||||||
-t ghcr.io/${{ github.repository }}:${{ github.ref_type == 'tag' && 'latest' || env.DOCKER_IMAGE_TAG }} \
|
-t ghcr.io/${{ github.repository }}:${LATEST_TAG} \
|
||||||
ghcr.io/${{ github.repository }}:${{ env.DOCKER_IMAGE_TAG }}-amd64 \
|
ghcr.io/${{ github.repository }}:${{ env.DOCKER_IMAGE_TAG }}-amd64 \
|
||||||
ghcr.io/${{ github.repository }}:${{ env.DOCKER_IMAGE_TAG }}-arm64
|
ghcr.io/${{ github.repository }}:${{ env.DOCKER_IMAGE_TAG }}-arm64
|
||||||
|
|
||||||
- name: Create and Push Cloud Manifest
|
- name: Create and Push Cloud Manifest
|
||||||
if: github.event.inputs.khoj-cloud == 'true' || github.event_name == 'push'
|
if: github.event.inputs.khoj-cloud == 'true' || github.event_name == 'push'
|
||||||
run: |
|
run: |
|
||||||
|
# Only put "latest.*" tag on stable releases (i.e 1.x, 2.x+)
|
||||||
|
if [[ "${{ env.DOCKER_IMAGE_TAG }}" =~ ^[1-9]\.[0-9]+\.[0-9]+$ ]]; then
|
||||||
|
LATEST_TAG="latest"
|
||||||
|
else
|
||||||
|
LATEST_TAG="${{ env.DOCKER_IMAGE_TAG }}"
|
||||||
|
fi
|
||||||
|
|
||||||
docker buildx imagetools create \
|
docker buildx imagetools create \
|
||||||
-t ghcr.io/${{ github.repository }}-cloud:${{ env.DOCKER_IMAGE_TAG }} \
|
-t ghcr.io/${{ github.repository }}-cloud:${{ env.DOCKER_IMAGE_TAG }} \
|
||||||
-t ghcr.io/${{ github.repository }}-cloud:${{ github.ref_type == 'tag' && 'latest' || env.DOCKER_IMAGE_TAG }} \
|
-t ghcr.io/${{ github.repository }}-cloud:${LATEST_TAG} \
|
||||||
ghcr.io/${{ github.repository }}-cloud:${{ env.DOCKER_IMAGE_TAG }}-amd64 \
|
ghcr.io/${{ github.repository }}-cloud:${{ env.DOCKER_IMAGE_TAG }}-amd64 \
|
||||||
ghcr.io/${{ github.repository }}-cloud:${{ env.DOCKER_IMAGE_TAG }}-arm64
|
ghcr.io/${{ github.repository }}-cloud:${{ env.DOCKER_IMAGE_TAG }}-arm64
|
||||||
|
|
||||||
|
|||||||
4
.github/workflows/pre-commit.yml
vendored
4
.github/workflows/pre-commit.yml
vendored
@@ -2,6 +2,9 @@ name: pre-commit
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
- release/1.x
|
||||||
paths:
|
paths:
|
||||||
- src/**
|
- src/**
|
||||||
- tests/**
|
- tests/**
|
||||||
@@ -12,6 +15,7 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
|
- release/1.x
|
||||||
paths:
|
paths:
|
||||||
- src/khoj/**
|
- src/khoj/**
|
||||||
- tests/**
|
- tests/**
|
||||||
|
|||||||
4
.github/workflows/pypi.yml
vendored
4
.github/workflows/pypi.yml
vendored
@@ -6,6 +6,7 @@ on:
|
|||||||
- "*"
|
- "*"
|
||||||
branches:
|
branches:
|
||||||
- 'master'
|
- 'master'
|
||||||
|
- 'release/1.x'
|
||||||
paths:
|
paths:
|
||||||
- src/khoj/**
|
- src/khoj/**
|
||||||
- src/interface/web/**
|
- src/interface/web/**
|
||||||
@@ -14,6 +15,7 @@ on:
|
|||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
- 'master'
|
- 'master'
|
||||||
|
- 'release/1.x'
|
||||||
paths:
|
paths:
|
||||||
- src/khoj/**
|
- src/khoj/**
|
||||||
- src/interface/web/**
|
- src/interface/web/**
|
||||||
@@ -74,7 +76,7 @@ jobs:
|
|||||||
path: dist/khoj-*.whl
|
path: dist/khoj-*.whl
|
||||||
|
|
||||||
- name: 📦 Publish Python Package to PyPI
|
- name: 📦 Publish Python Package to PyPI
|
||||||
if: startsWith(github.ref, 'refs/tags') || github.ref == 'refs/heads/master'
|
if: startsWith(github.ref, 'refs/tags') || github.ref == 'refs/heads/master' || github.ref == 'refs/heads/release/1.x'
|
||||||
uses: pypa/gh-action-pypi-publish@release/v1.12
|
uses: pypa/gh-action-pypi-publish@release/v1.12
|
||||||
with:
|
with:
|
||||||
skip-existing: true
|
skip-existing: true
|
||||||
|
|||||||
4
.github/workflows/test.yml
vendored
4
.github/workflows/test.yml
vendored
@@ -2,6 +2,9 @@ name: test
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- master
|
||||||
|
- release/1.x
|
||||||
paths:
|
paths:
|
||||||
- src/khoj/**
|
- src/khoj/**
|
||||||
- tests/**
|
- tests/**
|
||||||
@@ -13,6 +16,7 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
|
- release/1.x
|
||||||
paths:
|
paths:
|
||||||
- src/khoj/**
|
- src/khoj/**
|
||||||
- tests/**
|
- tests/**
|
||||||
|
|||||||
2
.github/workflows/test_khoj_el.yml
vendored
2
.github/workflows/test_khoj_el.yml
vendored
@@ -4,6 +4,7 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- 'master'
|
- 'master'
|
||||||
|
- 'release/1.x'
|
||||||
paths:
|
paths:
|
||||||
- src/interface/emacs/*.el
|
- src/interface/emacs/*.el
|
||||||
- src/interface/emacs/tests/*.el
|
- src/interface/emacs/tests/*.el
|
||||||
@@ -11,6 +12,7 @@ on:
|
|||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
- 'master'
|
- 'master'
|
||||||
|
- 'release/1.x'
|
||||||
paths:
|
paths:
|
||||||
- src/interface/emacs/*.el
|
- src/interface/emacs/*.el
|
||||||
- src/interface/emacs/tests/*.el
|
- src/interface/emacs/tests/*.el
|
||||||
|
|||||||
@@ -125,7 +125,7 @@ do
|
|||||||
$project_root/manifest.json \
|
$project_root/manifest.json \
|
||||||
$project_root/versions.json
|
$project_root/versions.json
|
||||||
git commit -m "Release Khoj version $current_version"
|
git commit -m "Release Khoj version $current_version"
|
||||||
git tag $current_version master
|
git tag $current_version
|
||||||
;;
|
;;
|
||||||
c)
|
c)
|
||||||
# Get current project version
|
# Get current project version
|
||||||
@@ -172,7 +172,7 @@ do
|
|||||||
$project_root/manifest.json \
|
$project_root/manifest.json \
|
||||||
$project_root/versions.json
|
$project_root/versions.json
|
||||||
git commit -m "Release Khoj version $current_version"
|
git commit -m "Release Khoj version $current_version"
|
||||||
git tag $current_version master
|
git tag $current_version
|
||||||
;;
|
;;
|
||||||
n)
|
n)
|
||||||
# Induce hatch to compute next version number
|
# Induce hatch to compute next version number
|
||||||
|
|||||||
Reference in New Issue
Block a user