chore: update cicd
This commit is contained in:
parent
78317e9c73
commit
b749b39ddf
28
.github/scripts/electron-checksum.py
vendored
Normal file
28
.github/scripts/electron-checksum.py
vendored
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
import hashlib
|
||||||
|
import base64
|
||||||
|
import sys
|
||||||
|
|
||||||
|
def hash_file(file_path):
|
||||||
|
# Create a SHA-512 hash object
|
||||||
|
sha512 = hashlib.sha512()
|
||||||
|
|
||||||
|
# Read and update the hash object with the content of the file
|
||||||
|
with open(file_path, 'rb') as f:
|
||||||
|
while True:
|
||||||
|
data = f.read(1024 * 1024) # Read in 1 MB chunks
|
||||||
|
if not data:
|
||||||
|
break
|
||||||
|
sha512.update(data)
|
||||||
|
|
||||||
|
# Obtain the hash result and encode it in base64
|
||||||
|
hash_base64 = base64.b64encode(sha512.digest()).decode('utf-8')
|
||||||
|
return hash_base64
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
if len(sys.argv) < 2:
|
||||||
|
print("Usage: python3 script.py <file_path>")
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
file_path = sys.argv[1]
|
||||||
|
hash_base64_output = hash_file(file_path)
|
||||||
|
print(hash_base64_output)
|
||||||
BIN
.github/scripts/icon-beta.png
vendored
Normal file
BIN
.github/scripts/icon-beta.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 49 KiB |
BIN
.github/scripts/icon-nightly.png
vendored
Normal file
BIN
.github/scripts/icon-nightly.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 49 KiB |
50
.github/workflows/jan-electron-build-nightly.yml
vendored
50
.github/workflows/jan-electron-build-nightly.yml
vendored
@ -55,8 +55,7 @@ jobs:
|
|||||||
ref: ${{ needs.set-public-provider.outputs.ref }}
|
ref: ${{ needs.set-public-provider.outputs.ref }}
|
||||||
public_provider: ${{ needs.set-public-provider.outputs.public_provider }}
|
public_provider: ${{ needs.set-public-provider.outputs.public_provider }}
|
||||||
new_version: ${{ needs.get-update-version.outputs.new_version }}
|
new_version: ${{ needs.get-update-version.outputs.new_version }}
|
||||||
nightly: true
|
channel: nightly
|
||||||
beta: false
|
|
||||||
cortex_api_port: "39261"
|
cortex_api_port: "39261"
|
||||||
|
|
||||||
build-windows-x64:
|
build-windows-x64:
|
||||||
@ -67,8 +66,7 @@ jobs:
|
|||||||
ref: ${{ needs.set-public-provider.outputs.ref }}
|
ref: ${{ needs.set-public-provider.outputs.ref }}
|
||||||
public_provider: ${{ needs.set-public-provider.outputs.public_provider }}
|
public_provider: ${{ needs.set-public-provider.outputs.public_provider }}
|
||||||
new_version: ${{ needs.get-update-version.outputs.new_version }}
|
new_version: ${{ needs.get-update-version.outputs.new_version }}
|
||||||
nightly: true
|
channel: nightly
|
||||||
beta: false
|
|
||||||
cortex_api_port: "39261"
|
cortex_api_port: "39261"
|
||||||
build-linux-x64:
|
build-linux-x64:
|
||||||
uses: ./.github/workflows/template-tauri-build-linux-x64.yml
|
uses: ./.github/workflows/template-tauri-build-linux-x64.yml
|
||||||
@ -78,17 +76,55 @@ jobs:
|
|||||||
ref: ${{ needs.set-public-provider.outputs.ref }}
|
ref: ${{ needs.set-public-provider.outputs.ref }}
|
||||||
public_provider: ${{ needs.set-public-provider.outputs.public_provider }}
|
public_provider: ${{ needs.set-public-provider.outputs.public_provider }}
|
||||||
new_version: ${{ needs.get-update-version.outputs.new_version }}
|
new_version: ${{ needs.get-update-version.outputs.new_version }}
|
||||||
nightly: true
|
channel: nightly
|
||||||
beta: false
|
|
||||||
cortex_api_port: "39261"
|
cortex_api_port: "39261"
|
||||||
|
|
||||||
sync-temp-to-latest:
|
sync-temp-to-latest:
|
||||||
needs: [set-public-provider, build-windows-x64, build-linux-x64, build-macos]
|
needs: [get-update-version, set-public-provider, build-windows-x64, build-linux-x64, build-macos]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
|
- name: Getting the repo
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
- name: Install jq
|
||||||
|
uses: dcarbone/install-jq-action@v2.0.1
|
||||||
|
- name: create latest.json file
|
||||||
|
run: |
|
||||||
|
|
||||||
|
VERSION=${{ needs.get-update-version.outputs.new_version }}
|
||||||
|
PUB_DATE=$(date -u +"%Y-%m-%dT%H:%M:%S.%3NZ")
|
||||||
|
LINUX_SIGNATURE="${{ needs.build-linux-x64.outputs.APPIMAGE_SIG }}"
|
||||||
|
LINUX_URL="https://delta.jan.ai/nightly/${{ needs.build-linux-x64.outputs.APPIMAGE_FILE_NAME }}"
|
||||||
|
WINDOWS_SIGNATURE="${{ needs.build-windows-x64.outputs.WIN_SIG }}"
|
||||||
|
WINDOWS_URL="https://delta.jan.ai/nightly/${{ needs.build-windows-x64.outputs.FILE_NAME }}"
|
||||||
|
DARWIN_SIGNATURE="${{ needs.build-macos.outputs.MAC_UNIVERSAL_SIG }}"
|
||||||
|
DARWIN_URL="https://delta.jan.ai/nightly/Jan-nightly_${{ needs.get-update-version.outputs.new_version }}.app.tar.gz"
|
||||||
|
|
||||||
|
jq --arg version "$VERSION" \
|
||||||
|
--arg pub_date "$PUB_DATE" \
|
||||||
|
--arg linux_signature "$LINUX_SIGNATURE" \
|
||||||
|
--arg linux_url "$LINUX_URL" \
|
||||||
|
--arg windows_signature "$WINDOWS_SIGNATURE" \
|
||||||
|
--arg windows_url "$WINDOWS_URL" \
|
||||||
|
--arg darwin_arm_signature "$DARWIN_SIGNATURE" \
|
||||||
|
--arg darwin_arm_url "$DARWIN_URL" \
|
||||||
|
--arg darwin_amd_signature "$DARWIN_SIGNATURE" \
|
||||||
|
--arg darwin_amd_url "$DARWIN_URL" \
|
||||||
|
'.version = $version
|
||||||
|
| .pub_date = $pub_date
|
||||||
|
| .platforms["linux-x86_64"].signature = $linux_signature
|
||||||
|
| .platforms["linux-x86_64"].url = $linux_url
|
||||||
|
| .platforms["windows-x86_64"].signature = $windows_signature
|
||||||
|
| .platforms["windows-x86_64"].url = $windows_url
|
||||||
|
| .platforms["darwin-aarch64"].signature = $darwin_arm_signature
|
||||||
|
| .platforms["darwin-aarch64"].url = $darwin_arm_url
|
||||||
|
| .platforms["darwin-x86_64"].signature = $darwin_amd_signature
|
||||||
|
| .platforms["darwin-x86_64"].url = $darwin_amd_url' \
|
||||||
|
src-tauri/latest.json.template > latest.json
|
||||||
|
cat latest.json
|
||||||
- name: Sync temp to latest
|
- name: Sync temp to latest
|
||||||
if: ${{ needs.set-public-provider.outputs.public_provider == 'aws-s3' }}
|
if: ${{ needs.set-public-provider.outputs.public_provider == 'aws-s3' }}
|
||||||
run: |
|
run: |
|
||||||
|
aws s3 cp ./latest.json s3://${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}/temp-nightly/latest.json
|
||||||
aws s3 sync s3://${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}/temp-nightly/ s3://${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}/nightly/
|
aws s3 sync s3://${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}/temp-nightly/ s3://${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}/nightly/
|
||||||
env:
|
env:
|
||||||
AWS_ACCESS_KEY_ID: ${{ secrets.DELTA_AWS_ACCESS_KEY_ID }}
|
AWS_ACCESS_KEY_ID: ${{ secrets.DELTA_AWS_ACCESS_KEY_ID }}
|
||||||
|
|||||||
55
.github/workflows/jan-tauri-build-beta.yml
vendored
55
.github/workflows/jan-tauri-build-beta.yml
vendored
@ -17,8 +17,7 @@ jobs:
|
|||||||
ref: ${{ github.ref }}
|
ref: ${{ github.ref }}
|
||||||
public_provider: github
|
public_provider: github
|
||||||
new_version: ${{ needs.get-update-version.outputs.new_version }}
|
new_version: ${{ needs.get-update-version.outputs.new_version }}
|
||||||
beta: true
|
channel: beta
|
||||||
nightly: false
|
|
||||||
cortex_api_port: "39271"
|
cortex_api_port: "39271"
|
||||||
|
|
||||||
build-windows-x64:
|
build-windows-x64:
|
||||||
@ -29,8 +28,7 @@ jobs:
|
|||||||
ref: ${{ github.ref }}
|
ref: ${{ github.ref }}
|
||||||
public_provider: github
|
public_provider: github
|
||||||
new_version: ${{ needs.get-update-version.outputs.new_version }}
|
new_version: ${{ needs.get-update-version.outputs.new_version }}
|
||||||
beta: true
|
channel: beta
|
||||||
nightly: false
|
|
||||||
cortex_api_port: "39271"
|
cortex_api_port: "39271"
|
||||||
|
|
||||||
build-linux-x64:
|
build-linux-x64:
|
||||||
@ -41,21 +39,56 @@ jobs:
|
|||||||
ref: ${{ github.ref }}
|
ref: ${{ github.ref }}
|
||||||
public_provider: github
|
public_provider: github
|
||||||
new_version: ${{ needs.get-update-version.outputs.new_version }}
|
new_version: ${{ needs.get-update-version.outputs.new_version }}
|
||||||
beta: true
|
channel: beta
|
||||||
nightly: false
|
|
||||||
cortex_api_port: "39271"
|
cortex_api_port: "39271"
|
||||||
|
|
||||||
sync-temp-to-latest:
|
sync-temp-to-latest:
|
||||||
needs: [build-macos, build-windows-x64, build-linux-x64]
|
needs: [get-update-version, build-macos, build-windows-x64, build-linux-x64]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
steps:
|
steps:
|
||||||
- name: Getting the repo
|
- name: Getting the repo
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: create latest.json file
|
||||||
|
run: |
|
||||||
|
|
||||||
|
VERSION=${{ needs.get-update-version.outputs.new_version }}
|
||||||
|
PUB_DATE=$(date -u +"%Y-%m-%dT%H:%M:%S.%3NZ")
|
||||||
|
LINUX_SIGNATURE="${{ needs.build-linux-x64.outputs.APPIMAGE_SIG }}"
|
||||||
|
LINUX_URL="https://delta.jan.ai/beta/${{ needs.build-linux-x64.outputs.APPIMAGE_FILE_NAME }}"
|
||||||
|
WINDOWS_SIGNATURE="${{ needs.build-windows-x64.outputs.WIN_SIG }}"
|
||||||
|
WINDOWS_URL="https://delta.jan.ai/beta/${{ needs.build-windows-x64.outputs.FILE_NAME }}"
|
||||||
|
DARWIN_SIGNATURE="${{ needs.build-macos.outputs.MAC_UNIVERSAL_SIG }}"
|
||||||
|
DARWIN_URL="https://delta.jan.ai/beta/Jan-beta_${{ needs.get-update-version.outputs.new_version }}.app.tar.gz"
|
||||||
|
|
||||||
|
jq --arg version "$VERSION" \
|
||||||
|
--arg pub_date "$PUB_DATE" \
|
||||||
|
--arg linux_signature "$LINUX_SIGNATURE" \
|
||||||
|
--arg linux_url "$LINUX_URL" \
|
||||||
|
--arg windows_signature "$WINDOWS_SIGNATURE" \
|
||||||
|
--arg windows_url "$WINDOWS_URL" \
|
||||||
|
--arg darwin_arm_signature "$DARWIN_SIGNATURE" \
|
||||||
|
--arg darwin_arm_url "$DARWIN_URL" \
|
||||||
|
--arg darwin_amd_signature "$DARWIN_SIGNATURE" \
|
||||||
|
--arg darwin_amd_url "$DARWIN_URL" \
|
||||||
|
'.version = $version
|
||||||
|
| .pub_date = $pub_date
|
||||||
|
| .platforms["linux-x86_64"].signature = $linux_signature
|
||||||
|
| .platforms["linux-x86_64"].url = $linux_url
|
||||||
|
| .platforms["windows-x86_64"].signature = $windows_signature
|
||||||
|
| .platforms["windows-x86_64"].url = $windows_url
|
||||||
|
| .platforms["darwin-aarch64"].signature = $darwin_arm_signature
|
||||||
|
| .platforms["darwin-aarch64"].url = $darwin_arm_url
|
||||||
|
| .platforms["darwin-x86_64"].signature = $darwin_amd_signature
|
||||||
|
| .platforms["darwin-x86_64"].url = $darwin_amd_url' \
|
||||||
|
src-tauri/latest.json.template > latest.json
|
||||||
|
cat latest.json
|
||||||
- name: Sync temp to latest
|
- name: Sync temp to latest
|
||||||
run: |
|
run: |
|
||||||
# sync temp-beta to beta by copy files that are different or new
|
# sync temp-beta to beta by copy files that are different or new
|
||||||
|
aws s3 cp ./latest.json s3://${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}/temp-beta/latest.json
|
||||||
aws s3 sync "s3://${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}/temp-beta/" "s3://${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}/beta/"
|
aws s3 sync "s3://${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}/temp-beta/" "s3://${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}/beta/"
|
||||||
env:
|
env:
|
||||||
AWS_ACCESS_KEY_ID: ${{ secrets.DELTA_AWS_ACCESS_KEY_ID }}
|
AWS_ACCESS_KEY_ID: ${{ secrets.DELTA_AWS_ACCESS_KEY_ID }}
|
||||||
@ -78,9 +111,9 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
args: |
|
args: |
|
||||||
Jan-beta App version {{ VERSION }}, has been released, use the following links to download the app with faster speed or visit the Github release page for more information:
|
Jan-beta App version {{ VERSION }}, has been released, use the following links to download the app with faster speed or visit the Github release page for more information:
|
||||||
- Windows: https://delta.jan.ai/beta/jan-beta-win-x64-{{ VERSION }}.exe
|
- Windows: https://delta.jan.ai/beta/Jan-beta_{{ VERSION }}_x64-setup.exe
|
||||||
- macOS Universal: https://delta.jan.ai/beta/jan-beta-mac-universal-{{ VERSION }}.dmg
|
- macOS Universal: https://delta.jan.ai/beta/Jan-beta_{{ VERSION }}_universal.dmg
|
||||||
- Linux Deb: https://delta.jan.ai/beta/jan-beta-linux-amd64-{{ VERSION }}.deb
|
- Linux Deb: https://delta.jan.ai/beta/Jan-beta_{{ VERSION }}_amd64.deb
|
||||||
- Linux AppImage: https://delta.jan.ai/beta/jan-beta-linux-x86_64-{{ VERSION }}.AppImage
|
- Linux AppImage: https://delta.jan.ai/beta/Jan-beta_{{ VERSION }}_amd64.AppImage
|
||||||
env:
|
env:
|
||||||
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK_JAN_BETA }}
|
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK_JAN_BETA }}
|
||||||
50
.github/workflows/jan-tauri-build-nightly.yml
vendored
50
.github/workflows/jan-tauri-build-nightly.yml
vendored
@ -55,8 +55,7 @@ jobs:
|
|||||||
ref: ${{ needs.set-public-provider.outputs.ref }}
|
ref: ${{ needs.set-public-provider.outputs.ref }}
|
||||||
public_provider: ${{ needs.set-public-provider.outputs.public_provider }}
|
public_provider: ${{ needs.set-public-provider.outputs.public_provider }}
|
||||||
new_version: ${{ needs.get-update-version.outputs.new_version }}
|
new_version: ${{ needs.get-update-version.outputs.new_version }}
|
||||||
nightly: true
|
channel: nightly
|
||||||
beta: false
|
|
||||||
cortex_api_port: "39261"
|
cortex_api_port: "39261"
|
||||||
|
|
||||||
build-windows-x64:
|
build-windows-x64:
|
||||||
@ -67,8 +66,7 @@ jobs:
|
|||||||
ref: ${{ needs.set-public-provider.outputs.ref }}
|
ref: ${{ needs.set-public-provider.outputs.ref }}
|
||||||
public_provider: ${{ needs.set-public-provider.outputs.public_provider }}
|
public_provider: ${{ needs.set-public-provider.outputs.public_provider }}
|
||||||
new_version: ${{ needs.get-update-version.outputs.new_version }}
|
new_version: ${{ needs.get-update-version.outputs.new_version }}
|
||||||
nightly: true
|
channel: nightly
|
||||||
beta: false
|
|
||||||
cortex_api_port: "39261"
|
cortex_api_port: "39261"
|
||||||
build-linux-x64:
|
build-linux-x64:
|
||||||
uses: ./.github/workflows/template-tauri-build-linux-x64.yml
|
uses: ./.github/workflows/template-tauri-build-linux-x64.yml
|
||||||
@ -78,17 +76,55 @@ jobs:
|
|||||||
ref: ${{ needs.set-public-provider.outputs.ref }}
|
ref: ${{ needs.set-public-provider.outputs.ref }}
|
||||||
public_provider: ${{ needs.set-public-provider.outputs.public_provider }}
|
public_provider: ${{ needs.set-public-provider.outputs.public_provider }}
|
||||||
new_version: ${{ needs.get-update-version.outputs.new_version }}
|
new_version: ${{ needs.get-update-version.outputs.new_version }}
|
||||||
nightly: true
|
channel: nightly
|
||||||
beta: false
|
|
||||||
cortex_api_port: "39261"
|
cortex_api_port: "39261"
|
||||||
|
|
||||||
sync-temp-to-latest:
|
sync-temp-to-latest:
|
||||||
needs: [set-public-provider, build-windows-x64, build-linux-x64, build-macos]
|
needs: [get-update-version, set-public-provider, build-windows-x64, build-linux-x64, build-macos]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
|
- name: Getting the repo
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
- name: Install jq
|
||||||
|
uses: dcarbone/install-jq-action@v2.0.1
|
||||||
|
- name: create latest.json file
|
||||||
|
run: |
|
||||||
|
|
||||||
|
VERSION=${{ needs.get-update-version.outputs.new_version }}
|
||||||
|
PUB_DATE=$(date -u +"%Y-%m-%dT%H:%M:%S.%3NZ")
|
||||||
|
LINUX_SIGNATURE="${{ needs.build-linux-x64.outputs.APPIMAGE_SIG }}"
|
||||||
|
LINUX_URL="https://delta.jan.ai/nightly/${{ needs.build-linux-x64.outputs.APPIMAGE_FILE_NAME }}"
|
||||||
|
WINDOWS_SIGNATURE="${{ needs.build-windows-x64.outputs.WIN_SIG }}"
|
||||||
|
WINDOWS_URL="https://delta.jan.ai/nightly/${{ needs.build-windows-x64.outputs.FILE_NAME }}"
|
||||||
|
DARWIN_SIGNATURE="${{ needs.build-macos.outputs.MAC_UNIVERSAL_SIG }}"
|
||||||
|
DARWIN_URL="https://delta.jan.ai/nightly/Jan-nightly_${{ needs.get-update-version.outputs.new_version }}.app.tar.gz"
|
||||||
|
|
||||||
|
jq --arg version "$VERSION" \
|
||||||
|
--arg pub_date "$PUB_DATE" \
|
||||||
|
--arg linux_signature "$LINUX_SIGNATURE" \
|
||||||
|
--arg linux_url "$LINUX_URL" \
|
||||||
|
--arg windows_signature "$WINDOWS_SIGNATURE" \
|
||||||
|
--arg windows_url "$WINDOWS_URL" \
|
||||||
|
--arg darwin_arm_signature "$DARWIN_SIGNATURE" \
|
||||||
|
--arg darwin_arm_url "$DARWIN_URL" \
|
||||||
|
--arg darwin_amd_signature "$DARWIN_SIGNATURE" \
|
||||||
|
--arg darwin_amd_url "$DARWIN_URL" \
|
||||||
|
'.version = $version
|
||||||
|
| .pub_date = $pub_date
|
||||||
|
| .platforms["linux-x86_64"].signature = $linux_signature
|
||||||
|
| .platforms["linux-x86_64"].url = $linux_url
|
||||||
|
| .platforms["windows-x86_64"].signature = $windows_signature
|
||||||
|
| .platforms["windows-x86_64"].url = $windows_url
|
||||||
|
| .platforms["darwin-aarch64"].signature = $darwin_arm_signature
|
||||||
|
| .platforms["darwin-aarch64"].url = $darwin_arm_url
|
||||||
|
| .platforms["darwin-x86_64"].signature = $darwin_amd_signature
|
||||||
|
| .platforms["darwin-x86_64"].url = $darwin_amd_url' \
|
||||||
|
src-tauri/latest.json.template > latest.json
|
||||||
|
cat latest.json
|
||||||
- name: Sync temp to latest
|
- name: Sync temp to latest
|
||||||
if: ${{ needs.set-public-provider.outputs.public_provider == 'aws-s3' }}
|
if: ${{ needs.set-public-provider.outputs.public_provider == 'aws-s3' }}
|
||||||
run: |
|
run: |
|
||||||
|
aws s3 cp ./latest.json s3://${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}/temp-nightly/latest.json
|
||||||
aws s3 sync s3://${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}/temp-nightly/ s3://${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}/nightly/
|
aws s3 sync s3://${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}/temp-nightly/ s3://${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}/nightly/
|
||||||
env:
|
env:
|
||||||
AWS_ACCESS_KEY_ID: ${{ secrets.DELTA_AWS_ACCESS_KEY_ID }}
|
AWS_ACCESS_KEY_ID: ${{ secrets.DELTA_AWS_ACCESS_KEY_ID }}
|
||||||
|
|||||||
63
.github/workflows/jan-tauri-build.yml
vendored
63
.github/workflows/jan-tauri-build.yml
vendored
@ -40,8 +40,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
ref: ${{ github.ref }}
|
ref: ${{ github.ref }}
|
||||||
public_provider: github
|
public_provider: github
|
||||||
beta: false
|
channel: stable
|
||||||
nightly: false
|
|
||||||
new_version: ${{ needs.get-update-version.outputs.new_version }}
|
new_version: ${{ needs.get-update-version.outputs.new_version }}
|
||||||
|
|
||||||
build-windows-x64:
|
build-windows-x64:
|
||||||
@ -51,8 +50,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
ref: ${{ github.ref }}
|
ref: ${{ github.ref }}
|
||||||
public_provider: github
|
public_provider: github
|
||||||
beta: false
|
channel: stable
|
||||||
nightly: false
|
|
||||||
new_version: ${{ needs.get-update-version.outputs.new_version }}
|
new_version: ${{ needs.get-update-version.outputs.new_version }}
|
||||||
|
|
||||||
build-linux-x64:
|
build-linux-x64:
|
||||||
@ -62,10 +60,63 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
ref: ${{ github.ref }}
|
ref: ${{ github.ref }}
|
||||||
public_provider: github
|
public_provider: github
|
||||||
beta: false
|
channel: stable
|
||||||
nightly: false
|
|
||||||
new_version: ${{ needs.get-update-version.outputs.new_version }}
|
new_version: ${{ needs.get-update-version.outputs.new_version }}
|
||||||
|
|
||||||
|
sync-temp-to-latest:
|
||||||
|
needs: [get-update-version, build-macos, build-windows-x64, build-linux-x64]
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
steps:
|
||||||
|
- name: Getting the repo
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: create latest.json file
|
||||||
|
run: |
|
||||||
|
|
||||||
|
VERSION=${{ needs.get-update-version.outputs.new_version }}
|
||||||
|
PUB_DATE=$(date -u +"%Y-%m-%dT%H:%M:%S.%3NZ")
|
||||||
|
LINUX_SIGNATURE="${{ needs.build-linux-x64.outputs.APPIMAGE_SIG }}"
|
||||||
|
LINUX_URL="https://github.com/menloresearch/jan/releases/download/v${{ needs.get-update-version.outputs.new_version }}/${{ needs.build-linux-x64.outputs.APPIMAGE_FILE_NAME }}"
|
||||||
|
WINDOWS_SIGNATURE="${{ needs.build-windows-x64.outputs.WIN_SIG }}"
|
||||||
|
WINDOWS_URL="https://github.com/menloresearch/jan/releases/download/v${{ needs.get-update-version.outputs.new_version }}/${{ needs.build-windows-x64.outputs.FILE_NAME }}"
|
||||||
|
DARWIN_SIGNATURE="${{ needs.build-macos.outputs.MAC_UNIVERSAL_SIG }}"
|
||||||
|
DARWIN_URL="https://github.com/menloresearch/jan/releases/download/v${{ needs.get-update-version.outputs.new_version }}/${{ needs.build-macos.outputs.TAR_NAME }}"
|
||||||
|
|
||||||
|
jq --arg version "$VERSION" \
|
||||||
|
--arg pub_date "$PUB_DATE" \
|
||||||
|
--arg linux_signature "$LINUX_SIGNATURE" \
|
||||||
|
--arg linux_url "$LINUX_URL" \
|
||||||
|
--arg windows_signature "$WINDOWS_SIGNATURE" \
|
||||||
|
--arg windows_url "$WINDOWS_URL" \
|
||||||
|
--arg darwin_arm_signature "$DARWIN_SIGNATURE" \
|
||||||
|
--arg darwin_arm_url "$DARWIN_URL" \
|
||||||
|
--arg darwin_amd_signature "$DARWIN_SIGNATURE" \
|
||||||
|
--arg darwin_amd_url "$DARWIN_URL" \
|
||||||
|
'.version = $version
|
||||||
|
| .pub_date = $pub_date
|
||||||
|
| .platforms["linux-x86_64"].signature = $linux_signature
|
||||||
|
| .platforms["linux-x86_64"].url = $linux_url
|
||||||
|
| .platforms["windows-x86_64"].signature = $windows_signature
|
||||||
|
| .platforms["windows-x86_64"].url = $windows_url
|
||||||
|
| .platforms["darwin-aarch64"].signature = $darwin_arm_signature
|
||||||
|
| .platforms["darwin-aarch64"].url = $darwin_arm_url
|
||||||
|
| .platforms["darwin-x86_64"].signature = $darwin_amd_signature
|
||||||
|
| .platforms["darwin-x86_64"].url = $darwin_amd_url' \
|
||||||
|
src-tauri/latest.json.template > latest.json
|
||||||
|
cat latest.json
|
||||||
|
- name: Sync temp to latest
|
||||||
|
run: |
|
||||||
|
# sync temp-beta to beta by copy files that are different or new
|
||||||
|
aws s3 cp ./latest.json s3://${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}/temp-beta/latest.json
|
||||||
|
aws s3 sync "s3://${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}/temp-beta/" "s3://${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}/beta/"
|
||||||
|
env:
|
||||||
|
AWS_ACCESS_KEY_ID: ${{ secrets.DELTA_AWS_ACCESS_KEY_ID }}
|
||||||
|
AWS_SECRET_ACCESS_KEY: ${{ secrets.DELTA_AWS_SECRET_ACCESS_KEY }}
|
||||||
|
AWS_DEFAULT_REGION: ${{ secrets.DELTA_AWS_REGION }}
|
||||||
|
AWS_EC2_METADATA_DISABLED: "true"
|
||||||
|
|
||||||
update_release_draft:
|
update_release_draft:
|
||||||
needs: [build-macos, build-windows-x64, build-linux-x64]
|
needs: [build-macos, build-windows-x64, build-linux-x64]
|
||||||
permissions:
|
permissions:
|
||||||
|
|||||||
@ -47,10 +47,10 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
args: |
|
args: |
|
||||||
Jan App ${{ inputs.build_reason }} build artifact version {{ VERSION }}:
|
Jan App ${{ inputs.build_reason }} build artifact version {{ VERSION }}:
|
||||||
- Windows: https://delta.jan.ai/nightly/jan-nightly-win-x64-{{ VERSION }}.exe
|
- Windows: https://delta.jan.ai/nightly/Jan-nightly_{{ VERSION }}_x64-setup.exe
|
||||||
- macOS Universal: https://delta.jan.ai/nightly/jan-nightly-mac-universal-{{ VERSION }}.dmg
|
- macOS Universal: https://delta.jan.ai/nightly/Jan-nightly_{{ VERSION }}_universal.dmg
|
||||||
- Linux Deb: https://delta.jan.ai/nightly/jan-nightly-linux-amd64-{{ VERSION }}.deb
|
- Linux Deb: https://delta.jan.ai/nightly/Jan-nightly_{{ VERSION }}_amd64.deb
|
||||||
- Linux AppImage: https://delta.jan.ai/nightly/jan-nightly-linux-x86_64-{{ VERSION }}.AppImage
|
- Linux AppImage: https://delta.jan.ai/nightly/Jan-nightly_{{ VERSION }}_amd64.AppImage
|
||||||
- Github action run: https://github.com/menloresearch/jan/actions/runs/{{ GITHUB_RUN_ID }}
|
- Github action run: https://github.com/menloresearch/jan/actions/runs/{{ GITHUB_RUN_ID }}
|
||||||
env:
|
env:
|
||||||
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
|
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
|
||||||
|
|||||||
260
.github/workflows/template-tauri-build-linux-x64.yml
vendored
260
.github/workflows/template-tauri-build-linux-x64.yml
vendored
@ -15,22 +15,19 @@ on:
|
|||||||
required: true
|
required: true
|
||||||
type: string
|
type: string
|
||||||
default: ''
|
default: ''
|
||||||
aws_s3_prefix:
|
|
||||||
required: false
|
|
||||||
type: string
|
|
||||||
default: '/latest/'
|
|
||||||
beta:
|
|
||||||
required: false
|
|
||||||
type: boolean
|
|
||||||
default: false
|
|
||||||
nightly:
|
|
||||||
required: false
|
|
||||||
type: boolean
|
|
||||||
default: false
|
|
||||||
cortex_api_port:
|
cortex_api_port:
|
||||||
required: false
|
required: false
|
||||||
type: string
|
type: string
|
||||||
default: null
|
default: ""
|
||||||
|
upload_url:
|
||||||
|
required: false
|
||||||
|
type: string
|
||||||
|
default: ''
|
||||||
|
channel:
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
default: 'nightly'
|
||||||
|
description: 'The channel to use for this job'
|
||||||
secrets:
|
secrets:
|
||||||
DELTA_AWS_S3_BUCKET_NAME:
|
DELTA_AWS_S3_BUCKET_NAME:
|
||||||
required: false
|
required: false
|
||||||
@ -44,10 +41,20 @@ on:
|
|||||||
required: false
|
required: false
|
||||||
TAURI_SIGNING_PUBLIC_KEY:
|
TAURI_SIGNING_PUBLIC_KEY:
|
||||||
required: false
|
required: false
|
||||||
|
outputs:
|
||||||
|
DEB_SIG:
|
||||||
|
value: ${{ jobs.build-linux-x64.outputs.DEB_SIG }}
|
||||||
|
APPIMAGE_SIG:
|
||||||
|
value: ${{ jobs.build-linux-x64.outputs.APPIMAGE_SIG }}
|
||||||
|
APPIMAGE_FILE_NAME:
|
||||||
|
value: ${{ jobs.build-linux-x64.outputs.APPIMAGE_FILE_NAME }}
|
||||||
jobs:
|
jobs:
|
||||||
build-linux-x64:
|
build-linux-x64:
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
|
outputs:
|
||||||
|
DEB_SIG: ${{ steps.packageinfo.outputs.DEB_SIG }}
|
||||||
|
APPIMAGE_SIG: ${{ steps.packageinfo.outputs.APPIMAGE_SIG }}
|
||||||
|
APPIMAGE_FILE_NAME: ${{ steps.packageinfo.outputs.APPIMAGE_FILE_NAME }}
|
||||||
environment: production
|
environment: production
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
@ -71,30 +78,11 @@ jobs:
|
|||||||
echo "Disk space after cleanup:"
|
echo "Disk space after cleanup:"
|
||||||
df -h
|
df -h
|
||||||
|
|
||||||
# - name: Replace Icons for Beta Build
|
- name: Replace Icons for Beta Build
|
||||||
# if: inputs.beta == true && inputs.nightly != true
|
if: inputs.channel != 'stable'
|
||||||
# shell: bash
|
shell: bash
|
||||||
# run: |
|
run: |
|
||||||
# rm -rf electron/icons/*
|
cp .github/scripts/icon-${{ inputs.channel }}.png src-tauri/icons/icon.png
|
||||||
|
|
||||||
# cp electron/icons_dev/jan-beta-512x512.png electron/icons/512x512.png
|
|
||||||
# cp electron/icons_dev/jan-beta.ico electron/icons/icon.ico
|
|
||||||
# cp electron/icons_dev/jan-beta.png electron/icons/icon.png
|
|
||||||
# cp electron/icons_dev/jan-beta-tray@2x.png electron/icons/icon-tray@2x.png
|
|
||||||
# cp electron/icons_dev/jan-beta-tray.png electron/icons/icon-tray.png
|
|
||||||
|
|
||||||
# - name: Replace Icons for Nightly Build
|
|
||||||
# if: inputs.nightly == true && inputs.beta != true
|
|
||||||
# shell: bash
|
|
||||||
# run: |
|
|
||||||
# rm -rf electron/icons/*
|
|
||||||
|
|
||||||
# cp electron/icons_dev/jan-nightly-512x512.png electron/icons/512x512.png
|
|
||||||
# cp electron/icons_dev/jan-nightly.ico electron/icons/icon.ico
|
|
||||||
# cp electron/icons_dev/jan-nightly.png electron/icons/icon.png
|
|
||||||
# cp electron/icons_dev/jan-nightly-tray@2x.png electron/icons/icon-tray@2x.png
|
|
||||||
# cp electron/icons_dev/jan-nightly-tray.png electron/icons/icon-tray.png
|
|
||||||
|
|
||||||
|
|
||||||
- name: Installing node
|
- name: Installing node
|
||||||
uses: actions/setup-node@v1
|
uses: actions/setup-node@v1
|
||||||
@ -114,76 +102,41 @@ jobs:
|
|||||||
sudo apt install -y libglib2.0-dev libatk1.0-dev libpango1.0-dev libgtk-3-dev libsoup-3.0-dev libwebkit2gtk-4.1-dev librsvg2-dev
|
sudo apt install -y libglib2.0-dev libatk1.0-dev libpango1.0-dev libgtk-3-dev libsoup-3.0-dev libwebkit2gtk-4.1-dev librsvg2-dev
|
||||||
|
|
||||||
- name: Update app version base public_provider
|
- name: Update app version base public_provider
|
||||||
if: inputs.public_provider != 'github'
|
|
||||||
run: |
|
run: |
|
||||||
echo "Version: ${{ inputs.new_version }}"
|
echo "Version: ${{ inputs.new_version }}"
|
||||||
# Update tauri.conf.json
|
# Update tauri.conf.json
|
||||||
jq --arg version "${{ inputs.new_version }}" '.version = $version | .bundle.createUpdaterArtifacts = true' ./src-tauri/tauri.conf.json > /tmp/tauri.conf.json
|
jq --arg version "${{ inputs.new_version }}" '.version = $version | .bundle.createUpdaterArtifacts = true' ./src-tauri/tauri.conf.json > /tmp/tauri.conf.json
|
||||||
mv /tmp/tauri.conf.json ./src-tauri/tauri.conf.json
|
mv /tmp/tauri.conf.json ./src-tauri/tauri.conf.json
|
||||||
|
jq --arg version "${{ inputs.new_version }}" '.version = $version' web/package.json > /tmp/package.json
|
||||||
chmod +x .github/scripts/rename-tauri-app.sh
|
|
||||||
.github/scripts/rename-tauri-app.sh ./src-tauri/tauri.conf.json nightly
|
|
||||||
|
|
||||||
echo ./src-tauri/tauri.conf.json
|
|
||||||
|
|
||||||
# Update Cargo.toml
|
|
||||||
ctoml ./src-tauri/Cargo.toml package.name "Jan-nightly"
|
|
||||||
ctoml ./src-tauri/Cargo.toml package.version "${{ inputs.new_version }}"
|
|
||||||
echo "------------------"
|
|
||||||
cat ./src-tauri/Cargo.toml
|
|
||||||
|
|
||||||
chmod +x .github/scripts/rename-workspace.sh
|
|
||||||
.github/scripts/rename-workspace.sh ./package.json nightly
|
|
||||||
|
|
||||||
- name: Change App Name for beta version
|
|
||||||
if: inputs.beta == true
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
chmod +x .github/scripts/rename-tauri-app.sh
|
|
||||||
.github/scripts/rename-tauri-app.sh ./src-tauri/tauri.conf.json beta
|
|
||||||
cat ./src-tauri/tauri.conf.json
|
|
||||||
echo "------------------"
|
|
||||||
ctoml ./src-tauri/Cargo.toml package.name "Jan-beta"
|
|
||||||
cat ./src-tauri/Cargo.toml
|
|
||||||
echo "------------------"
|
|
||||||
chmod +x .github/scripts/rename-workspace.sh
|
|
||||||
.github/scripts/rename-workspace.sh ./package.json beta
|
|
||||||
cat ./package.json
|
|
||||||
|
|
||||||
- name: Update app version base on tag
|
|
||||||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') && inputs.public_provider == 'github'
|
|
||||||
run: |
|
|
||||||
jq --arg version "${VERSION_TAG#v}" '.version = $version | .bundle.createUpdaterArtifacts = true' ./src-tauri/tauri.conf.json > /tmp/tauri.conf.json
|
|
||||||
mv /tmp/tauri.conf.json ./src-tauri/tauri.conf.json
|
|
||||||
ctoml ./src-tauri/Cargo.toml package.version "${VERSION_TAG#v}"
|
|
||||||
jq --arg version "${VERSION_TAG#v}" '.version = $version' web/package.json > /tmp/package.json
|
|
||||||
mv /tmp/package.json web/package.json
|
mv /tmp/package.json web/package.json
|
||||||
env:
|
|
||||||
VERSION_TAG: ${{ inputs.new_version }}
|
|
||||||
|
|
||||||
- name: Inject Tauri Signing Public Key
|
ctoml ./src-tauri/Cargo.toml package.version "${{ inputs.new_version }}"
|
||||||
run: |
|
cat ./src-tauri/Cargo.toml
|
||||||
if [ -f "src-tauri/tauri.conf.json" ]; then
|
|
||||||
echo "Injecting Tauri public key into configuration..."
|
# Change app name for beta and nightly builds
|
||||||
# Use jq to update the pubkey field in the tauri.conf.json file
|
if [ "${{ inputs.channel }}" != "stable" ]; then
|
||||||
jq --arg pubkey "$TAURI_SIGNING_PUBLIC_KEY" '.plugins.updater.pubkey = $pubkey' src-tauri/tauri.conf.json > /tmp/tauri.conf.json
|
jq '.plugins.updater.endpoints = ["https://delta.jan.ai/${{ inputs.channel }}/latest.json"]' ./src-tauri/tauri.conf.json > /tmp/tauri.conf.json
|
||||||
mv /tmp/tauri.conf.json src-tauri/tauri.conf.json
|
mv /tmp/tauri.conf.json ./src-tauri/tauri.conf.json
|
||||||
echo "Tauri configuration updated successfully"
|
|
||||||
else
|
chmod +x .github/scripts/rename-tauri-app.sh
|
||||||
echo "tauri.conf.json not found"
|
.github/scripts/rename-tauri-app.sh ./src-tauri/tauri.conf.json ${{ inputs.channel }}
|
||||||
|
|
||||||
|
cat ./src-tauri/tauri.conf.json
|
||||||
|
|
||||||
|
# Update Cargo.toml
|
||||||
|
ctoml ./src-tauri/Cargo.toml package.name "Jan-${{ inputs.channel }}"
|
||||||
|
echo "------------------"
|
||||||
|
cat ./src-tauri/Cargo.toml
|
||||||
|
|
||||||
|
chmod +x .github/scripts/rename-workspace.sh
|
||||||
|
.github/scripts/rename-workspace.sh ./package.json ${{ inputs.channel }}
|
||||||
|
cat ./package.json
|
||||||
fi
|
fi
|
||||||
env:
|
|
||||||
TAURI_SIGNING_PUBLIC_KEY: ${{ secrets.TAURI_SIGNING_PUBLIC_KEY }}
|
|
||||||
|
|
||||||
- name: Build app
|
- name: Build app
|
||||||
run: |
|
run: |
|
||||||
make build-tauri
|
make build-tauri
|
||||||
env:
|
env:
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
AWS_ACCESS_KEY_ID: ${{ secrets.DELTA_AWS_ACCESS_KEY_ID }}
|
|
||||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.DELTA_AWS_SECRET_ACCESS_KEY }}
|
|
||||||
AWS_EC2_METADATA_DISABLED: 'true'
|
|
||||||
AWS_MAX_ATTEMPTS: '5'
|
|
||||||
POSTHOG_KEY: ${{ secrets.POSTHOG_KEY }}
|
POSTHOG_KEY: ${{ secrets.POSTHOG_KEY }}
|
||||||
POSTHOG_HOST: ${{ secrets.POSTHOG_HOST }}
|
POSTHOG_HOST: ${{ secrets.POSTHOG_HOST }}
|
||||||
# CORTEX_API_PORT: ${{ inputs.cortex_api_port }}
|
# CORTEX_API_PORT: ${{ inputs.cortex_api_port }}
|
||||||
@ -191,6 +144,9 @@ jobs:
|
|||||||
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
|
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
|
||||||
TAURI_SIGNING_PUBLIC_KEY: ${{ secrets.TAURI_SIGNING_PUBLIC_KEY }}
|
TAURI_SIGNING_PUBLIC_KEY: ${{ secrets.TAURI_SIGNING_PUBLIC_KEY }}
|
||||||
|
|
||||||
|
# Publish app
|
||||||
|
|
||||||
|
## Artifacts, for dev and test
|
||||||
- name: Upload Artifact
|
- name: Upload Artifact
|
||||||
if: inputs.public_provider != 'github'
|
if: inputs.public_provider != 'github'
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
@ -198,13 +154,6 @@ jobs:
|
|||||||
name: jan-linux-amd64-${{ inputs.new_version }}-deb
|
name: jan-linux-amd64-${{ inputs.new_version }}-deb
|
||||||
path: ./src-tauri/target/release/bundle/deb/*.deb
|
path: ./src-tauri/target/release/bundle/deb/*.deb
|
||||||
|
|
||||||
- name: Upload Artifact
|
|
||||||
if: inputs.public_provider != 'github'
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: jan-linux-amd64-${{ inputs.new_version }}.deb.sig
|
|
||||||
path: ./src-tauri/target/release/bundle/deb/*.deb.sig
|
|
||||||
|
|
||||||
- name: Upload Artifact
|
- name: Upload Artifact
|
||||||
if: inputs.public_provider != 'github'
|
if: inputs.public_provider != 'github'
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
@ -212,9 +161,106 @@ jobs:
|
|||||||
name: jan-linux-amd64-${{ inputs.new_version }}-AppImage
|
name: jan-linux-amd64-${{ inputs.new_version }}-AppImage
|
||||||
path: ./src-tauri/target/release/bundle/appimage/*.AppImage
|
path: ./src-tauri/target/release/bundle/appimage/*.AppImage
|
||||||
|
|
||||||
- name: Upload Artifact
|
## create zip file and latest-linux.yml for linux electron auto updater
|
||||||
if: inputs.public_provider != 'github'
|
- name: Create zip file and latest-linux.yml for linux electron auto updater
|
||||||
uses: actions/upload-artifact@v4
|
id: packageinfo
|
||||||
|
run: |
|
||||||
|
cd ./src-tauri/target/release/bundle
|
||||||
|
|
||||||
|
if [ "${{ inputs.channel }}" != "stable" ]; then
|
||||||
|
DEB_FILE_NAME=Jan-${{ inputs.channel }}_${{ inputs.new_version }}_amd64.deb
|
||||||
|
APPIMAGE_FILE_NAME=Jan-${{ inputs.channel }}_${{ inputs.new_version }}_amd64.AppImage
|
||||||
|
DEB_SIG=$(cat deb/Jan-${{ inputs.channel }}_${{ inputs.new_version }}_amd64.deb.sig)
|
||||||
|
APPIMAGE_SIG=$(cat appimage/Jan-${{ inputs.channel }}_${{ inputs.new_version }}_amd64.AppImage.sig)
|
||||||
|
else
|
||||||
|
DEB_FILE_NAME=Jan_${{ inputs.new_version }}_amd64.deb
|
||||||
|
APPIMAGE_FILE_NAME=Jan_${{ inputs.new_version }}_amd64.AppImage
|
||||||
|
DEB_SIG=$(cat deb/Jan_${{ inputs.new_version }}_amd64.deb.sig)
|
||||||
|
APPIMAGE_SIG=$(cat appimage/Jan_${{ inputs.new_version }}_amd64.AppImage.sig)
|
||||||
|
fi
|
||||||
|
|
||||||
|
DEB_FILE_SIZE=$(stat -c%s deb/$DEB_FILE_NAME)
|
||||||
|
APPIMAGE_FILE_SIZE=$(stat -c%s appimage/$APPIMAGE_FILE_NAME)
|
||||||
|
echo "deb file size: $DEB_FILE_SIZE"
|
||||||
|
echo "appimage file size: $APPIMAGE_FILE_SIZE"
|
||||||
|
|
||||||
|
DEB_SH512_CHECKSUM=$(python3 ../../../../.github/scripts/electron-checksum.py deb/$DEB_FILE_NAME)
|
||||||
|
APPIMAGE_SH512_CHECKSUM=$(python3 ../../../../.github/scripts/electron-checksum.py appimage/$APPIMAGE_FILE_NAME)
|
||||||
|
echo "deb sh512 checksum: $DEB_SH512_CHECKSUM"
|
||||||
|
echo "appimage sh512 checksum: $APPIMAGE_SH512_CHECKSUM"
|
||||||
|
|
||||||
|
CURRENT_TIME=$(date -u +"%Y-%m-%dT%H:%M:%S.%3NZ")
|
||||||
|
echo "releaseDate: $CURRENT_TIME"
|
||||||
|
|
||||||
|
# Create latest-linux.yml file
|
||||||
|
echo "version: ${{ inputs.new_version }}" > latest-linux.yml
|
||||||
|
echo "files:" >> latest-linux.yml
|
||||||
|
echo " - url: $DEB_FILE_NAME" >> latest-linux.yml
|
||||||
|
echo " sha512: $DEB_SH512_CHECKSUM" >> latest-linux.yml
|
||||||
|
echo " size: $DEB_FILE_SIZE" >> latest-linux.yml
|
||||||
|
echo " - url: $APPIMAGE_FILE_NAME" >> latest-linux.yml
|
||||||
|
echo " sha512: $APPIMAGE_SH512_CHECKSUM" >> latest-linux.yml
|
||||||
|
echo " size: $APPIMAGE_FILE_SIZE" >> latest-linux.yml
|
||||||
|
echo "path: $APPIMAGE_FILE_NAME" >> latest-linux.yml
|
||||||
|
echo "sha512: $APPIMAGE_SH512_CHECKSUM" >> latest-linux.yml
|
||||||
|
echo "releaseDate: $CURRENT_TIME" >> latest-linux.yml
|
||||||
|
|
||||||
|
cat latest-linux.yml
|
||||||
|
cp latest-linux.yml beta-linux.yml
|
||||||
|
|
||||||
|
echo "DEB_SIG=$DEB_SIG" >> $GITHUB_OUTPUT
|
||||||
|
echo "APPIMAGE_SIG=$APPIMAGE_SIG" >> $GITHUB_OUTPUT
|
||||||
|
echo "DEB_FILE_NAME=$DEB_FILE_NAME" >> $GITHUB_OUTPUT
|
||||||
|
echo "APPIMAGE_FILE_NAME=$APPIMAGE_FILE_NAME" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
## Upload to s3 for nightly and beta
|
||||||
|
- name: upload to aws s3 if public provider is aws
|
||||||
|
if: inputs.public_provider == 'aws-s3' || inputs.channel == 'beta'
|
||||||
|
run: |
|
||||||
|
cd ./src-tauri/target/release/bundle
|
||||||
|
|
||||||
|
# Upload for electron updater
|
||||||
|
aws s3 cp ./latest-linux.yml s3://${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}/temp-${{ inputs.channel }}/latest-linux.yml
|
||||||
|
aws s3 cp ./beta-linux.yml s3://${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}/temp-${{ inputs.channel }}/beta-linux.yml
|
||||||
|
|
||||||
|
# Upload for tauri updater
|
||||||
|
aws s3 cp ./appimage/Jan-${{ inputs.channel }}_${{ inputs.new_version }}_amd64.AppImage s3://${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}/temp-${{ inputs.channel }}/Jan-${{ inputs.channel }}_${{ inputs.new_version }}_amd64.AppImage
|
||||||
|
aws s3 cp ./deb/Jan-${{ inputs.channel }}_${{ inputs.new_version }}_amd64.deb s3://${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}/temp-${{ inputs.channel }}/Jan-${{ inputs.channel }}_${{ inputs.new_version }}_amd64.deb
|
||||||
|
env:
|
||||||
|
AWS_ACCESS_KEY_ID: ${{ secrets.DELTA_AWS_ACCESS_KEY_ID }}
|
||||||
|
AWS_SECRET_ACCESS_KEY: ${{ secrets.DELTA_AWS_SECRET_ACCESS_KEY }}
|
||||||
|
AWS_DEFAULT_REGION: ${{ secrets.DELTA_AWS_REGION }}
|
||||||
|
AWS_EC2_METADATA_DISABLED: "true"
|
||||||
|
|
||||||
|
## Upload to github release for stable release
|
||||||
|
- name: Upload release assert if public provider is github
|
||||||
|
if: inputs.public_provider == 'github'
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
uses: actions/upload-release-asset@v1.0.1
|
||||||
with:
|
with:
|
||||||
name: jan-linux-amd64-${{ inputs.new_version }}.AppImage.sig
|
upload_url: ${{ inputs.upload_url }}
|
||||||
path: ./src-tauri/target/release/bundle/appimage/*.AppImage.sig
|
asset_path: ./src-tauri/target/release/bundle/latest-linux.yml
|
||||||
|
asset_name: latest-linux.yml
|
||||||
|
asset_content_type: text/yaml
|
||||||
|
- name: Upload release assert if public provider is github
|
||||||
|
if: inputs.public_provider == 'github'
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
uses: actions/upload-release-asset@v1.0.1
|
||||||
|
with:
|
||||||
|
upload_url: ${{ inputs.upload_url }}
|
||||||
|
asset_path: ./src-tauri/target/release/bundle/appimage/${{ steps.packageinfo.outputs.APPIMAGE_FILE_NAME }}
|
||||||
|
asset_name: ${{ steps.packageinfo.outputs.APPIMAGE_FILE_NAME }}
|
||||||
|
asset_content_type: application/octet-stream
|
||||||
|
|
||||||
|
- name: Upload release assert if public provider is github
|
||||||
|
if: inputs.public_provider == 'github'
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
uses: actions/upload-release-asset@v1.0.1
|
||||||
|
with:
|
||||||
|
upload_url: ${{ inputs.upload_url }}
|
||||||
|
asset_path: ./src-tauri/target/release/bundle/deb/${{ steps.packageinfo.outputs.DEB_FILE_NAME }}
|
||||||
|
asset_name: ${{ steps.packageinfo.outputs.DEB_FILE_NAME }}
|
||||||
|
asset_content_type: application/octet-stream
|
||||||
|
|||||||
261
.github/workflows/template-tauri-build-macos.yml
vendored
261
.github/workflows/template-tauri-build-macos.yml
vendored
@ -15,22 +15,19 @@ on:
|
|||||||
required: true
|
required: true
|
||||||
type: string
|
type: string
|
||||||
default: ''
|
default: ''
|
||||||
aws_s3_prefix:
|
|
||||||
required: false
|
|
||||||
type: string
|
|
||||||
default: '/latest/'
|
|
||||||
beta:
|
|
||||||
required: false
|
|
||||||
type: boolean
|
|
||||||
default: false
|
|
||||||
nightly:
|
|
||||||
required: false
|
|
||||||
type: boolean
|
|
||||||
default: false
|
|
||||||
cortex_api_port:
|
cortex_api_port:
|
||||||
required: false
|
required: false
|
||||||
type: string
|
type: string
|
||||||
default: null
|
default: ""
|
||||||
|
upload_url:
|
||||||
|
required: false
|
||||||
|
type: string
|
||||||
|
default: ''
|
||||||
|
channel:
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
default: 'nightly'
|
||||||
|
description: 'The channel to use for this job'
|
||||||
secrets:
|
secrets:
|
||||||
DELTA_AWS_S3_BUCKET_NAME:
|
DELTA_AWS_S3_BUCKET_NAME:
|
||||||
required: false
|
required: false
|
||||||
@ -54,10 +51,18 @@ on:
|
|||||||
required: false
|
required: false
|
||||||
TAURI_SIGNING_PUBLIC_KEY:
|
TAURI_SIGNING_PUBLIC_KEY:
|
||||||
required: false
|
required: false
|
||||||
|
outputs:
|
||||||
|
MAC_UNIVERSAL_SIG:
|
||||||
|
value: ${{ jobs.build-macos.outputs.MAC_UNIVERSAL_SIG }}
|
||||||
|
TAR_NAME:
|
||||||
|
value: ${{ jobs.build-macos.outputs.TAR_NAME }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-macos:
|
build-macos:
|
||||||
runs-on: macos-latest
|
runs-on: macos-latest
|
||||||
|
outputs:
|
||||||
|
MAC_UNIVERSAL_SIG: ${{ steps.metadata.outputs.MAC_UNIVERSAL_SIG }}
|
||||||
|
TAR_NAME: ${{ steps.metadata.outputs.TAR_NAME }}
|
||||||
environment: production
|
environment: production
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
@ -66,30 +71,11 @@ jobs:
|
|||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
ref: ${{ inputs.ref }}
|
ref: ${{ inputs.ref }}
|
||||||
|
- name: Replace Icons for Beta Build
|
||||||
# - name: Replace Icons for Beta Build
|
if: inputs.channel != 'stable'
|
||||||
# if: inputs.beta == true && inputs.nightly != true
|
shell: bash
|
||||||
# shell: bash
|
run: |
|
||||||
# run: |
|
cp .github/scripts/icon-${{ inputs.channel }}.png src-tauri/icons/icon.png
|
||||||
# rm -rf electron/icons/*
|
|
||||||
|
|
||||||
# cp electron/icons_dev/jan-beta-512x512.png electron/icons/512x512.png
|
|
||||||
# cp electron/icons_dev/jan-beta.ico electron/icons/icon.ico
|
|
||||||
# cp electron/icons_dev/jan-beta.png electron/icons/icon.png
|
|
||||||
# cp electron/icons_dev/jan-beta-tray@2x.png electron/icons/icon-tray@2x.png
|
|
||||||
# cp electron/icons_dev/jan-beta-tray.png electron/icons/icon-tray.png
|
|
||||||
|
|
||||||
# - name: Replace Icons for Nightly Build
|
|
||||||
# if: inputs.nightly == true && inputs.beta != true
|
|
||||||
# shell: bash
|
|
||||||
# run: |
|
|
||||||
# rm -rf electron/icons/*
|
|
||||||
|
|
||||||
# cp electron/icons_dev/jan-nightly-512x512.png electron/icons/512x512.png
|
|
||||||
# cp electron/icons_dev/jan-nightly.ico electron/icons/icon.ico
|
|
||||||
# cp electron/icons_dev/jan-nightly.png electron/icons/icon.png
|
|
||||||
# cp electron/icons_dev/jan-nightly-tray@2x.png electron/icons/icon-tray@2x.png
|
|
||||||
# cp electron/icons_dev/jan-nightly-tray.png electron/icons/icon-tray.png
|
|
||||||
|
|
||||||
- name: Installing node
|
- name: Installing node
|
||||||
uses: actions/setup-node@v1
|
uses: actions/setup-node@v1
|
||||||
@ -104,56 +90,36 @@ jobs:
|
|||||||
cargo install ctoml
|
cargo install ctoml
|
||||||
|
|
||||||
- name: Update app version based on latest release tag with build number
|
- name: Update app version based on latest release tag with build number
|
||||||
if: inputs.public_provider != 'github'
|
|
||||||
run: |
|
run: |
|
||||||
echo "Version: ${{ inputs.new_version }}"
|
echo "Version: ${{ inputs.new_version }}"
|
||||||
# Update tauri.conf.json
|
# Update tauri.conf.json
|
||||||
jq --arg version "${{ inputs.new_version }}" '.version = $version | .bundle.createUpdaterArtifacts = true' ./src-tauri/tauri.conf.json > /tmp/tauri.conf.json
|
jq --arg version "${{ inputs.new_version }}" '.version = $version | .bundle.createUpdaterArtifacts = true' ./src-tauri/tauri.conf.json > /tmp/tauri.conf.json
|
||||||
mv /tmp/tauri.conf.json ./src-tauri/tauri.conf.json
|
mv /tmp/tauri.conf.json ./src-tauri/tauri.conf.json
|
||||||
|
|
||||||
chmod +x .github/scripts/rename-tauri-app.sh
|
|
||||||
.github/scripts/rename-tauri-app.sh ./src-tauri/tauri.conf.json nightly
|
|
||||||
echo ./src-tauri/tauri.conf.json
|
|
||||||
|
|
||||||
# Update Cargo.toml
|
|
||||||
ctoml ./src-tauri/Cargo.toml package.name "Jan-nightly"
|
|
||||||
ctoml ./src-tauri/Cargo.toml package.version "${{ inputs.new_version }}"
|
|
||||||
echo "------------------"
|
|
||||||
cat ./src-tauri/Cargo.toml
|
|
||||||
|
|
||||||
jq --arg version "${{ inputs.new_version }}" '.version = $version' web/package.json > /tmp/package.json
|
jq --arg version "${{ inputs.new_version }}" '.version = $version' web/package.json > /tmp/package.json
|
||||||
mv /tmp/package.json web/package.json
|
mv /tmp/package.json web/package.json
|
||||||
|
|
||||||
chmod +x .github/scripts/rename-workspace.sh
|
ctoml ./src-tauri/Cargo.toml package.version "${{ inputs.new_version }}"
|
||||||
.github/scripts/rename-workspace.sh ./package.json nightly
|
|
||||||
cat ./package.json
|
|
||||||
|
|
||||||
- name: Change App Name for beta version
|
|
||||||
if: inputs.beta == true
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
chmod +x .github/scripts/rename-tauri-app.sh
|
|
||||||
.github/scripts/rename-tauri-app.sh ./src-tauri/tauri.conf.json beta
|
|
||||||
cat ./src-tauri/tauri.conf.json
|
|
||||||
echo "------------------"
|
|
||||||
ctoml ./src-tauri/Cargo.toml package.name "Jan-beta"
|
|
||||||
cat ./src-tauri/Cargo.toml
|
cat ./src-tauri/Cargo.toml
|
||||||
echo "------------------"
|
|
||||||
chmod +x .github/scripts/rename-workspace.sh
|
|
||||||
.github/scripts/rename-workspace.sh ./package.json beta
|
|
||||||
cat ./package.json
|
|
||||||
|
|
||||||
- name: Update app version base on tag
|
# Change app name for beta and nightly builds
|
||||||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') && inputs.public_provider == 'github'
|
if [ "${{ inputs.channel }}" != "stable" ]; then
|
||||||
run: |
|
jq '.plugins.updater.endpoints = ["https://delta.jan.ai/${{ inputs.channel }}/latest.json"]' ./src-tauri/tauri.conf.json > /tmp/tauri.conf.json
|
||||||
jq --arg version "${VERSION_TAG#v}" '.version = $version | .bundle.createUpdaterArtifacts = true' ./src-tauri/tauri.conf.json > /tmp/tauri.conf.json
|
mv /tmp/tauri.conf.json ./src-tauri/tauri.conf.json
|
||||||
mv /tmp/tauri.conf.json ./src-tauri/tauri.conf.json
|
|
||||||
ctoml ./src-tauri/Cargo.toml package.version "${VERSION_TAG#v}"
|
|
||||||
jq --arg version "${VERSION_TAG#v}" '.version = $version' web/package.json > /tmp/package.json
|
|
||||||
mv /tmp/package.json web/package.json
|
|
||||||
env:
|
|
||||||
VERSION_TAG: ${{ inputs.new_version }}
|
|
||||||
|
|
||||||
|
chmod +x .github/scripts/rename-tauri-app.sh
|
||||||
|
.github/scripts/rename-tauri-app.sh ./src-tauri/tauri.conf.json ${{ inputs.channel }}
|
||||||
|
|
||||||
|
cat ./src-tauri/tauri.conf.json
|
||||||
|
|
||||||
|
# Update Cargo.toml
|
||||||
|
ctoml ./src-tauri/Cargo.toml package.name "Jan-${{ inputs.channel }}"
|
||||||
|
echo "------------------"
|
||||||
|
cat ./src-tauri/Cargo.toml
|
||||||
|
|
||||||
|
chmod +x .github/scripts/rename-workspace.sh
|
||||||
|
.github/scripts/rename-workspace.sh ./package.json ${{ inputs.channel }}
|
||||||
|
cat ./package.json
|
||||||
|
fi
|
||||||
- name: Get key for notarize
|
- name: Get key for notarize
|
||||||
run: base64 -d <<< "$NOTARIZE_P8_BASE64" > /tmp/notary-key.p8
|
run: base64 -d <<< "$NOTARIZE_P8_BASE64" > /tmp/notary-key.p8
|
||||||
shell: bash
|
shell: bash
|
||||||
@ -166,22 +132,9 @@ jobs:
|
|||||||
p12-file-base64: ${{ secrets.CODE_SIGN_P12_BASE64 }}
|
p12-file-base64: ${{ secrets.CODE_SIGN_P12_BASE64 }}
|
||||||
p12-password: ${{ secrets.CODE_SIGN_P12_PASSWORD }}
|
p12-password: ${{ secrets.CODE_SIGN_P12_PASSWORD }}
|
||||||
|
|
||||||
- name: Inject Tauri Signing Public Key
|
|
||||||
run: |
|
|
||||||
if [ -f "src-tauri/tauri.conf.json" ]; then
|
|
||||||
echo "Injecting Tauri public key into configuration..."
|
|
||||||
# Use jq to update the pubkey field in the tauri.conf.json file
|
|
||||||
jq --arg pubkey "$TAURI_SIGNING_PUBLIC_KEY" '.plugins.updater.pubkey = $pubkey' src-tauri/tauri.conf.json > /tmp/tauri.conf.json
|
|
||||||
mv /tmp/tauri.conf.json src-tauri/tauri.conf.json
|
|
||||||
echo "Tauri configuration updated successfully"
|
|
||||||
else
|
|
||||||
echo "tauri.conf.json not found"
|
|
||||||
fi
|
|
||||||
env:
|
|
||||||
TAURI_SIGNING_PUBLIC_KEY: ${{ secrets.TAURI_SIGNING_PUBLIC_KEY }}
|
|
||||||
|
|
||||||
- name: Build app
|
- name: Build app
|
||||||
run: |
|
run: |
|
||||||
|
rustup target add x86_64-apple-darwin
|
||||||
make build-tauri
|
make build-tauri
|
||||||
env:
|
env:
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
@ -198,26 +151,124 @@ jobs:
|
|||||||
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
|
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
|
||||||
TAURI_SIGNING_PUBLIC_KEY: ${{ secrets.TAURI_SIGNING_PUBLIC_KEY }}
|
TAURI_SIGNING_PUBLIC_KEY: ${{ secrets.TAURI_SIGNING_PUBLIC_KEY }}
|
||||||
|
|
||||||
- name: Upload Artifact
|
# Publish app
|
||||||
if: inputs.public_provider != 'github'
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
with:
|
|
||||||
name: jan-mac-universal-${{ inputs.new_version }}.dmg
|
|
||||||
path: |
|
|
||||||
./src-tauri/target/release/bundle/dmg/*.dmg
|
|
||||||
|
|
||||||
|
## Artifacts, for dev and test
|
||||||
- name: Upload Artifact
|
- name: Upload Artifact
|
||||||
if: inputs.public_provider != 'github'
|
if: inputs.public_provider != 'github'
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: jan-mac-universal-${{ inputs.new_version }}.app.tar.gz
|
name: jan-${{ inputs.channel }}-mac-universal-${{ inputs.new_version }}.dmg
|
||||||
path: |
|
path: |
|
||||||
./src-tauri/target/release/bundle/macos/Jan-nightly.app.tar.gz
|
./src-tauri/target/universal-apple-darwin/release/bundle/dmg/*.dmg
|
||||||
|
|
||||||
- name: Upload Artifact
|
|
||||||
if: inputs.public_provider != 'github'
|
## create zip file and latest-mac.yml for mac electron auto updater
|
||||||
uses: actions/upload-artifact@v4
|
- name: create zip file and latest-mac.yml for mac electron auto updater
|
||||||
|
run: |
|
||||||
|
cd ./src-tauri/target/universal-apple-darwin/release/bundle/macos
|
||||||
|
if [ "${{ inputs.channel }}" != "stable" ]; then
|
||||||
|
zip -r jan-${{ inputs.channel }}-mac-universal-${{ inputs.new_version }}.zip Jan-${{ inputs.channel }}.app
|
||||||
|
FILE_NAME=jan-${{ inputs.channel }}-mac-universal-${{ inputs.new_version }}.zip
|
||||||
|
DMG_NAME=Jan--${{ inputs.channel }}_${{ inputs.new_version }}_universal.dmg
|
||||||
|
MAC_UNIVERSAL_SIG=$(cat Jan-${{ inputs.channel }}.app.tar.gz.sig)
|
||||||
|
TAR_NAME=Jan-${{ inputs.channel }}.app.tar.gz
|
||||||
|
else
|
||||||
|
zip -r jan-mac-universal-${{ inputs.new_version }}.zip Jan.app
|
||||||
|
FILE_NAME=jan-mac-universal-${{ inputs.new_version }}.zip
|
||||||
|
MAC_UNIVERSAL_SIG=$(cat Jan.app.tar.gz.sig)
|
||||||
|
DMG_NAME=Jan--${{ inputs.channel }}_${{ inputs.new_version }}_universal.dmg
|
||||||
|
TAR_NAME=Jan.app.tar.gz
|
||||||
|
fi
|
||||||
|
|
||||||
|
FILE_SIZE=$(stat -f%z $FILE_NAME)
|
||||||
|
echo "size: $FILE_SIZE"
|
||||||
|
|
||||||
|
SH512_CHECKSUM=$(python3 ../../../../../../.github/scripts/electron-checksum.py $FILE_NAME)
|
||||||
|
echo "sha512: $SH512_CHECKSUM"
|
||||||
|
CURRENT_TIME=$(date -u +"%Y-%m-%dT%H:%M:%S.%3NZ")
|
||||||
|
echo "releaseDate: $CURRENT_TIME"
|
||||||
|
|
||||||
|
# Create latest-mac.yml file
|
||||||
|
echo "version: ${{ inputs.new_version }}" > latest-mac.yml
|
||||||
|
echo "files:" >> latest-mac.yml
|
||||||
|
echo " - url: $FILE_NAME" >> latest-mac.yml
|
||||||
|
echo " sha512: $SH512_CHECKSUM" >> latest-mac.yml
|
||||||
|
echo " size: $FILE_NAME" >> latest-mac.yml
|
||||||
|
echo "path: $FILE_NAME" >> latest-mac.yml
|
||||||
|
echo "sha512: $SH512_CHECKSUM" >> latest-mac.yml
|
||||||
|
echo "releaseDate: $CURRENT_TIME" >> latest-mac.yml
|
||||||
|
|
||||||
|
cat latest-mac.yml
|
||||||
|
cp latest-mac.yml beta-mac.yml
|
||||||
|
|
||||||
|
echo "::set-output name=MAC_UNIVERSAL_SIG::$MAC_UNIVERSAL_SIG"
|
||||||
|
echo "::set-output name=FILE_NAME::$FILE_NAME"
|
||||||
|
echo "::set-output name=DMG_NAME::$DMG_NAME"
|
||||||
|
echo "::set-output name=TAR_NAME::$TAR_NAME"
|
||||||
|
id: metadata
|
||||||
|
|
||||||
|
## Upload to s3 for nightly and beta
|
||||||
|
- name: upload to aws s3 if public provider is aws
|
||||||
|
if: inputs.public_provider == 'aws-s3' || inputs.channel == 'beta'
|
||||||
|
run: |
|
||||||
|
cd ./src-tauri/target/universal-apple-darwin/release/bundle
|
||||||
|
|
||||||
|
# Upload for electron updater
|
||||||
|
aws s3 cp ./macos/latest-mac.yml s3://${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}/temp-${{ inputs.channel }}/latest-mac.yml
|
||||||
|
aws s3 cp ./macos/beta-mac.yml s3://${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}/temp-${{ inputs.channel }}/beta-mac.yml
|
||||||
|
aws s3 cp ./macos/jan-${{ inputs.channel }}-mac-universal-${{ inputs.new_version }}.zip s3://${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}/temp-${{ inputs.channel }}/jan-${{ inputs.channel }}-mac-universal-${{ inputs.new_version }}.zip
|
||||||
|
|
||||||
|
# Upload for tauri updater
|
||||||
|
aws s3 cp ./dmg/Jan-${{ inputs.channel }}_${{ inputs.new_version }}_universal.dmg s3://${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}/temp-${{ inputs.channel }}/Jan-${{ inputs.channel }}_${{ inputs.new_version }}_universal.dmg
|
||||||
|
aws s3 cp ./macos/Jan-${{ inputs.channel }}.app.tar.gz s3://${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}/temp-${{ inputs.channel }}//Jan-${{ inputs.channel }}_${{ inputs.new_version }}.app.tar.gz
|
||||||
|
env:
|
||||||
|
AWS_ACCESS_KEY_ID: ${{ secrets.DELTA_AWS_ACCESS_KEY_ID }}
|
||||||
|
AWS_SECRET_ACCESS_KEY: ${{ secrets.DELTA_AWS_SECRET_ACCESS_KEY }}
|
||||||
|
AWS_DEFAULT_REGION: ${{ secrets.DELTA_AWS_REGION }}
|
||||||
|
AWS_EC2_METADATA_DISABLED: "true"
|
||||||
|
|
||||||
|
## Upload to github release for stable release
|
||||||
|
- name: Upload release assert if public provider is github
|
||||||
|
if: inputs.public_provider == 'github'
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
uses: actions/upload-release-asset@v1.0.1
|
||||||
with:
|
with:
|
||||||
name: jan-mac-universal-${{ inputs.new_version }}.app.tar.gz.sig
|
upload_url: ${{ inputs.upload_url }}
|
||||||
path: |
|
asset_path: ./src-tauri/target/universal-apple-darwin/release/macos/latest-mac.yml
|
||||||
./src-tauri/target/release/bundle/macos/Jan-nightly.app.tar.gz.sig
|
asset_name: latest-mac.yml
|
||||||
|
asset_content_type: text/yaml
|
||||||
|
|
||||||
|
- name: Upload release assert if public provider is github
|
||||||
|
if: inputs.public_provider == 'github'
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
uses: actions/upload-release-asset@v1.0.1
|
||||||
|
with:
|
||||||
|
upload_url: ${{ inputs.upload_url }}
|
||||||
|
asset_path: ./src-tauri/target/universal-apple-darwin/release/macos/${{ steps.metadata.outputs.FILE_NAME }}
|
||||||
|
asset_name: ${{ steps.metadata.outputs.FILE_NAME }}
|
||||||
|
asset_content_type: application/gzip
|
||||||
|
|
||||||
|
- name: Upload release assert if public provider is github
|
||||||
|
if: inputs.public_provider == 'github'
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
uses: actions/upload-release-asset@v1.0.1
|
||||||
|
with:
|
||||||
|
upload_url: ${{ inputs.upload_url }}
|
||||||
|
asset_path: ./src-tauri/target/universal-apple-darwin/release/dmg/${{ steps.metadata.outputs.DMG_NAME }}
|
||||||
|
asset_name: ${{ steps.metadata.outputs.DMG_NAME }}
|
||||||
|
asset_content_type: application/octet-stream
|
||||||
|
|
||||||
|
- name: Upload release assert if public provider is github
|
||||||
|
if: inputs.public_provider == 'github'
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
uses: actions/upload-release-asset@v1.0.1
|
||||||
|
with:
|
||||||
|
upload_url: ${{ inputs.upload_url }}
|
||||||
|
asset_path: ./src-tauri/target/universal-apple-darwin/release/macos/${{ steps.metadata.outputs.TAR_NAME }}
|
||||||
|
asset_name: ${{ steps.metadata.outputs.TAR_NAME }}
|
||||||
|
asset_content_type: application/gzip
|
||||||
@ -14,23 +14,20 @@ on:
|
|||||||
new_version:
|
new_version:
|
||||||
required: true
|
required: true
|
||||||
type: string
|
type: string
|
||||||
default: ""
|
default: ''
|
||||||
aws_s3_prefix:
|
|
||||||
required: false
|
|
||||||
type: string
|
|
||||||
default: "/latest/"
|
|
||||||
beta:
|
|
||||||
required: false
|
|
||||||
type: boolean
|
|
||||||
default: false
|
|
||||||
nightly:
|
|
||||||
required: false
|
|
||||||
type: boolean
|
|
||||||
default: false
|
|
||||||
cortex_api_port:
|
cortex_api_port:
|
||||||
required: false
|
required: false
|
||||||
type: string
|
type: string
|
||||||
default: null
|
default: ""
|
||||||
|
upload_url:
|
||||||
|
required: false
|
||||||
|
type: string
|
||||||
|
default: ''
|
||||||
|
channel:
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
default: 'nightly'
|
||||||
|
description: 'The channel to use for this job'
|
||||||
secrets:
|
secrets:
|
||||||
DELTA_AWS_S3_BUCKET_NAME:
|
DELTA_AWS_S3_BUCKET_NAME:
|
||||||
required: false
|
required: false
|
||||||
@ -54,10 +51,18 @@ on:
|
|||||||
required: false
|
required: false
|
||||||
TAURI_SIGNING_PUBLIC_KEY:
|
TAURI_SIGNING_PUBLIC_KEY:
|
||||||
required: false
|
required: false
|
||||||
|
outputs:
|
||||||
|
WIN_SIG:
|
||||||
|
value: ${{ jobs.build-windows-x64.outputs.WIN_SIG }}
|
||||||
|
FILE_NAME:
|
||||||
|
value: ${{ jobs.build-windows-x64.outputs.FILE_NAME }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-windows-x64:
|
build-windows-x64:
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
|
outputs:
|
||||||
|
WIN_SIG: ${{ steps.metadata.outputs.WIN_SIG }}
|
||||||
|
FILE_NAME: ${{ steps.metadata.outputs.FILE_NAME }}
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
steps:
|
steps:
|
||||||
@ -66,29 +71,11 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
ref: ${{ inputs.ref }}
|
ref: ${{ inputs.ref }}
|
||||||
|
|
||||||
# - name: Replace Icons for Beta Build
|
- name: Replace Icons for Beta Build
|
||||||
# if: inputs.beta == true && inputs.nightly != true
|
if: inputs.channel != 'stable'
|
||||||
# shell: bash
|
shell: bash
|
||||||
# run: |
|
run: |
|
||||||
# rm -rf electron/icons/*
|
cp .github/scripts/icon-${{ inputs.channel }}.png src-tauri/icons/icon.png
|
||||||
|
|
||||||
# cp electron/icons_dev/jan-beta-512x512.png electron/icons/512x512.png
|
|
||||||
# cp electron/icons_dev/jan-beta.ico electron/icons/icon.ico
|
|
||||||
# cp electron/icons_dev/jan-beta.png electron/icons/icon.png
|
|
||||||
# cp electron/icons_dev/jan-beta-tray@2x.png electron/icons/icon-tray@2x.png
|
|
||||||
# cp electron/icons_dev/jan-beta-tray.png electron/icons/icon-tray.png
|
|
||||||
|
|
||||||
# - name: Replace Icons for Nightly Build
|
|
||||||
# if: inputs.nightly == true && inputs.beta != true
|
|
||||||
# shell: bash
|
|
||||||
# run: |
|
|
||||||
# rm -rf electron/icons/*
|
|
||||||
|
|
||||||
# cp electron/icons_dev/jan-nightly-512x512.png electron/icons/512x512.png
|
|
||||||
# cp electron/icons_dev/jan-nightly.ico electron/icons/icon.ico
|
|
||||||
# cp electron/icons_dev/jan-nightly.png electron/icons/icon.png
|
|
||||||
# cp electron/icons_dev/jan-nightly-tray@2x.png electron/icons/icon-tray@2x.png
|
|
||||||
# cp electron/icons_dev/jan-nightly-tray.png electron/icons/icon-tray.png
|
|
||||||
|
|
||||||
- name: Installing node
|
- name: Installing node
|
||||||
uses: actions/setup-node@v1
|
uses: actions/setup-node@v1
|
||||||
@ -109,123 +96,76 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
echo "Version: ${{ inputs.new_version }}"
|
echo "Version: ${{ inputs.new_version }}"
|
||||||
# Update tauri.conf.json
|
# Update tauri.conf.json
|
||||||
jq --arg version "${{ inputs.new_version }}" --arg template tauri.bundle.windows.nsis.template '.version = $version | .bundle.createUpdaterArtifacts = true | .bundle.windows.nsis.template = $template' ./src-tauri/tauri.conf.json > /tmp/tauri.conf.json
|
jq --arg version "${{ inputs.new_version }}" '.version = $version | .bundle.createUpdaterArtifacts = true' ./src-tauri/tauri.conf.json > /tmp/tauri.conf.json
|
||||||
mv /tmp/tauri.conf.json ./src-tauri/tauri.conf.json
|
mv /tmp/tauri.conf.json ./src-tauri/tauri.conf.json
|
||||||
|
|
||||||
chmod +x .github/scripts/rename-tauri-app.sh
|
|
||||||
.github/scripts/rename-tauri-app.sh ./src-tauri/tauri.conf.json nightly
|
|
||||||
echo ./src-tauri/tauri.conf.json
|
|
||||||
|
|
||||||
# Update Cargo.toml
|
|
||||||
ctoml ./src-tauri/Cargo.toml package.name "Jan-nightly"
|
|
||||||
ctoml ./src-tauri/Cargo.toml package.version "${{ inputs.new_version }}"
|
|
||||||
echo "------------------"
|
|
||||||
cat ./src-tauri/Cargo.toml
|
|
||||||
|
|
||||||
# Update template
|
|
||||||
get_latest_tag() {
|
|
||||||
local retries=0
|
|
||||||
local max_retries=3
|
|
||||||
local tag
|
|
||||||
while [ $retries -lt $max_retries ]; do
|
|
||||||
tag=$(curl -s https://api.github.com/repos/menloresearch/jan/releases/latest | jq -r .tag_name)
|
|
||||||
if [ -n "$tag" ] && [ "$tag" != "null" ]; then
|
|
||||||
echo $tag
|
|
||||||
return
|
|
||||||
else
|
|
||||||
let retries++
|
|
||||||
echo "Retrying... ($retries/$max_retries)"
|
|
||||||
sleep 2
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
echo "Failed to fetch latest tag after $max_retries attempts."
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
LATEST_TAG=$(get_latest_tag)
|
|
||||||
jan_tag="${LATEST_TAG#v}.0"
|
|
||||||
echo $jan_tag
|
|
||||||
sed -i "s/jan_productname/Jan-nightly/g" ./src-tauri/tauri.bundle.windows.nsis.template
|
|
||||||
sed -i "s/jan_version/${{ inputs.new_version }}/g" ./src-tauri/tauri.bundle.windows.nsis.template
|
|
||||||
sed -i "s/jan_build/$jan_tag/g" ./src-tauri/tauri.bundle.windows.nsis.template
|
|
||||||
sed -i "s/jan_mainbinaryname/jan-nightly/g" ./src-tauri/tauri.bundle.windows.nsis.template
|
|
||||||
echo "------------------"
|
|
||||||
cat ./src-tauri/tauri.bundle.windows.nsis.template
|
|
||||||
|
|
||||||
jq --arg version "${{ inputs.new_version }}" '.version = $version' web/package.json > /tmp/package.json
|
jq --arg version "${{ inputs.new_version }}" '.version = $version' web/package.json > /tmp/package.json
|
||||||
mv /tmp/package.json web/package.json
|
mv /tmp/package.json web/package.json
|
||||||
|
|
||||||
chmod +x .github/scripts/rename-workspace.sh
|
ctoml ./src-tauri/Cargo.toml package.version "${{ inputs.new_version }}"
|
||||||
.github/scripts/rename-workspace.sh ./package.json nightly
|
|
||||||
chmod +x .github/scripts/rename-uninstaller.sh
|
|
||||||
.github/scripts/rename-uninstaller.sh nightly
|
|
||||||
echo "------------------------"
|
|
||||||
cat ./package.json
|
|
||||||
echo "------------------------"
|
|
||||||
|
|
||||||
- name: Change App Name for beta version
|
|
||||||
if: inputs.beta == true
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
chmod +x .github/scripts/rename-tauri-app.sh
|
|
||||||
.github/scripts/rename-tauri-app.sh ./src-tauri/tauri.conf.json beta
|
|
||||||
cat ./src-tauri/tauri.conf.json
|
|
||||||
echo "------------------"
|
|
||||||
ctoml ./src-tauri/Cargo.toml package.name "Jan-beta"
|
|
||||||
cat ./src-tauri/Cargo.toml
|
cat ./src-tauri/Cargo.toml
|
||||||
echo "------------------"
|
|
||||||
chmod +x .github/scripts/rename-workspace.sh
|
|
||||||
.github/scripts/rename-workspace.sh ./package.json beta
|
|
||||||
chmod +x .github/scripts/rename-uninstaller.sh
|
|
||||||
.github/scripts/rename-uninstaller.sh beta
|
|
||||||
echo "------------------------"
|
|
||||||
cat ./package.json
|
|
||||||
echo "------------------------"
|
|
||||||
cat ./electron/scripts/uninstaller.nsh
|
|
||||||
|
|
||||||
- name: Update app version base on tag
|
generate_build_version() {
|
||||||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') && inputs.public_provider == 'github'
|
### Examble
|
||||||
shell: bash
|
### input 0.5.6 output will be 0.5.6 and 0.5.6.0
|
||||||
run: |
|
### input 0.5.6-rc2-beta output will be 0.5.6 and 0.5.6.2
|
||||||
echo "Version: ${{ inputs.new_version }}"
|
### input 0.5.6-1213 output will be 0.5.6 and and 0.5.6.1213
|
||||||
# Update tauri.conf.json
|
local new_version="$1"
|
||||||
jq --arg version "${VERSION_TAG#v}" --arg template tauri.bundle.windows.nsis.template '.version = $version | .bundle.createUpdaterArtifacts = true | .bundle.windows.nsis.template = $template' ./src-tauri/tauri.conf.json > /tmp/tauri.conf.json
|
local base_version
|
||||||
mv /tmp/tauri.conf.json ./src-tauri/tauri.conf.json
|
local t_value
|
||||||
|
|
||||||
ctoml ./src-tauri/Cargo.toml package.version "${VERSION_TAG#v}"
|
# Check if it has a "-"
|
||||||
|
if [[ "$new_version" == *-* ]]; then
|
||||||
|
base_version="${new_version%%-*}" # part before -
|
||||||
|
suffix="${new_version#*-}" # part after -
|
||||||
|
|
||||||
jan_tag="${VERSION_TAG#v}.0"
|
# Check if it is rcX-beta
|
||||||
sed -i "s/jan_productname/Jan-beta/g" ./src-tauri/tauri.bundle.windows.nsis.template
|
if [[ "$suffix" =~ ^rc([0-9]+)-beta$ ]]; then
|
||||||
sed -i "s/jan_version/${VERSION_TAG#v}/g" ./src-tauri/tauri.bundle.windows.nsis.template
|
t_value="${BASH_REMATCH[1]}"
|
||||||
sed -i "s/jan_build/$jan_tag/g" ./src-tauri/tauri.bundle.windows.nsis.template
|
else
|
||||||
sed -i "s/jan_mainbinaryname/jan-beta/g" ./src-tauri/tauri.bundle.windows.nsis.template
|
t_value="$suffix"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
base_version="$new_version"
|
||||||
|
t_value="0"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Export two values
|
||||||
|
new_base_version="$base_version"
|
||||||
|
new_build_version="${base_version}.${t_value}"
|
||||||
|
}
|
||||||
|
generate_build_version ${{ inputs.new_version }}
|
||||||
|
sed -i "s/jan_version/$new_base_version/g" ./src-tauri/tauri.bundle.windows.nsis.template
|
||||||
|
sed -i "s/jan_build/$new_build_version/g" ./src-tauri/tauri.bundle.windows.nsis.template
|
||||||
echo "------------------"
|
echo "------------------"
|
||||||
cat ./src-tauri/tauri.bundle.windows.nsis.template
|
cat ./src-tauri/tauri.bundle.windows.nsis.template
|
||||||
|
|
||||||
jq --arg version "${VERSION_TAG#v}" '.version = $version' web/package.json > /tmp/package.json
|
# Change app name for beta and nightly builds
|
||||||
mv /tmp/package.json web/package.json
|
if [ "${{ inputs.channel }}" != "stable" ]; then
|
||||||
env:
|
jq '.plugins.updater.endpoints = ["https://delta.jan.ai/${{ inputs.channel }}/latest.json"]' ./src-tauri/tauri.conf.json > /tmp/tauri.conf.json
|
||||||
VERSION_TAG: ${{ inputs.new_version }}
|
mv /tmp/tauri.conf.json ./src-tauri/tauri.conf.json
|
||||||
|
|
||||||
|
chmod +x .github/scripts/rename-tauri-app.sh
|
||||||
|
.github/scripts/rename-tauri-app.sh ./src-tauri/tauri.conf.json ${{ inputs.channel }}
|
||||||
|
|
||||||
|
cat ./src-tauri/tauri.conf.json
|
||||||
|
|
||||||
|
# Update Cargo.toml
|
||||||
|
ctoml ./src-tauri/Cargo.toml package.name "Jan-${{ inputs.channel }}"
|
||||||
|
echo "------------------"
|
||||||
|
cat ./src-tauri/Cargo.toml
|
||||||
|
|
||||||
|
chmod +x .github/scripts/rename-workspace.sh
|
||||||
|
.github/scripts/rename-workspace.sh ./package.json ${{ inputs.channel }}
|
||||||
|
cat ./package.json
|
||||||
|
|
||||||
|
sed -i "s/jan_productname/Jan-${{ inputs.channel }}/g" ./src-tauri/tauri.bundle.windows.nsis.template
|
||||||
|
sed -i "s/jan_mainbinaryname/jan-${{ inputs.channel }}/g" ./src-tauri/tauri.bundle.windows.nsis.template
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Install AzureSignTool
|
- name: Install AzureSignTool
|
||||||
run: |
|
run: |
|
||||||
dotnet tool install --global --version 6.0.0 AzureSignTool
|
dotnet tool install --global --version 6.0.0 AzureSignTool
|
||||||
|
|
||||||
- name: Inject Tauri Signing Public Key
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
if [ -f "src-tauri/tauri.conf.json" ]; then
|
|
||||||
echo "Injecting Tauri public key into configuration..."
|
|
||||||
# Use jq to update the pubkey field in the tauri.conf.json file
|
|
||||||
jq --arg pubkey "$TAURI_SIGNING_PUBLIC_KEY" '.plugins.updater.pubkey = $pubkey' src-tauri/tauri.conf.json > /tmp/tauri.conf.json
|
|
||||||
mv /tmp/tauri.conf.json src-tauri/tauri.conf.json
|
|
||||||
echo "Tauri configuration updated successfully"
|
|
||||||
else
|
|
||||||
echo "tauri.conf.json not found"
|
|
||||||
fi
|
|
||||||
env:
|
|
||||||
TAURI_SIGNING_PUBLIC_KEY: ${{ secrets.TAURI_SIGNING_PUBLIC_KEY }}
|
|
||||||
|
|
||||||
- name: Build app
|
- name: Build app
|
||||||
shell: bash
|
shell: bash
|
||||||
if: inputs.public_provider != 'github'
|
if: inputs.public_provider != 'github'
|
||||||
@ -256,9 +196,82 @@ jobs:
|
|||||||
path: |
|
path: |
|
||||||
./src-tauri/target/release/bundle/nsis/*.exe
|
./src-tauri/target/release/bundle/nsis/*.exe
|
||||||
|
|
||||||
- name: Upload Artifact
|
## create zip file and latest.yml for windows electron auto updater
|
||||||
uses: actions/upload-artifact@v4
|
- name: create zip file and latest.yml for windows electron auto updater
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
cd ./src-tauri/target/release/bundle/nsis
|
||||||
|
if [ "${{ inputs.channel }}" != "stable" ]; then
|
||||||
|
FILE_NAME=Jan-${{ inputs.channel }}_${{ inputs.new_version }}_x64-setup.exe
|
||||||
|
WIN_SIG=$(cat Jan-${{ inputs.channel }}_${{ inputs.new_version }}_x64-setup.exe.sig)
|
||||||
|
else
|
||||||
|
FILE_NAME=Jan_${{ inputs.new_version }}_x64-setup.exe
|
||||||
|
WIN_SIG=$(cat Jan_${{ inputs.new_version }}_x64-setup.exe.sig)
|
||||||
|
fi
|
||||||
|
|
||||||
|
FILE_SIZE=$(stat -c %s $FILE_NAME)
|
||||||
|
echo "size: $FILE_SIZE"
|
||||||
|
|
||||||
|
SH512_CHECKSUM=$(python3 ../../../../../.github/scripts/electron-checksum.py $FILE_NAME)
|
||||||
|
echo "sha512: $SH512_CHECKSUM"
|
||||||
|
CURRENT_TIME=$(date -u +"%Y-%m-%dT%H:%M:%S.%3NZ")
|
||||||
|
echo "releaseDate: $CURRENT_TIME"
|
||||||
|
|
||||||
|
# Create latest.yml file
|
||||||
|
echo "version: ${{ inputs.new_version }}" > latest.yml
|
||||||
|
echo "files:" >> latest.yml
|
||||||
|
echo " - url: $FILE_NAME" >> latest.yml
|
||||||
|
echo " sha512: $SH512_CHECKSUM" >> latest.yml
|
||||||
|
echo " size: $FILE_NAME" >> latest.yml
|
||||||
|
echo "path: $FILE_NAME" >> latest.yml
|
||||||
|
echo "sha512: $SH512_CHECKSUM" >> latest.yml
|
||||||
|
echo "releaseDate: $CURRENT_TIME" >> latest.yml
|
||||||
|
|
||||||
|
cat latest.yml
|
||||||
|
cp latest.yml beta.yml
|
||||||
|
|
||||||
|
echo "::set-output name=WIN_SIG::$WIN_SIG"
|
||||||
|
echo "::set-output name=FILE_NAME::$FILE_NAME"
|
||||||
|
id: metadata
|
||||||
|
|
||||||
|
## Upload to s3 for nightly and beta
|
||||||
|
- name: upload to aws s3 if public provider is aws
|
||||||
|
shell: bash
|
||||||
|
if: inputs.public_provider == 'aws-s3' || inputs.channel == 'beta'
|
||||||
|
run: |
|
||||||
|
cd ./src-tauri/target/release/bundle/nsis
|
||||||
|
|
||||||
|
# Upload for electron updater
|
||||||
|
aws s3 cp ./latest.yml s3://${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}/temp-${{ inputs.channel }}/latest.yml
|
||||||
|
aws s3 cp ./beta.yml s3://${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}/temp-${{ inputs.channel }}/beta.yml
|
||||||
|
|
||||||
|
# Upload for tauri updater
|
||||||
|
aws s3 cp ./${{ steps.metadata.outputs.FILE_NAME }} s3://${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}/temp-${{ inputs.channel }}/${{ steps.metadata.outputs.FILE_NAME }}
|
||||||
|
env:
|
||||||
|
AWS_ACCESS_KEY_ID: ${{ secrets.DELTA_AWS_ACCESS_KEY_ID }}
|
||||||
|
AWS_SECRET_ACCESS_KEY: ${{ secrets.DELTA_AWS_SECRET_ACCESS_KEY }}
|
||||||
|
AWS_DEFAULT_REGION: ${{ secrets.DELTA_AWS_REGION }}
|
||||||
|
AWS_EC2_METADATA_DISABLED: "true"
|
||||||
|
|
||||||
|
## Upload to github release for stable release
|
||||||
|
- name: Upload release assert if public provider is github
|
||||||
|
if: inputs.public_provider == 'github'
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
uses: actions/upload-release-asset@v1.0.1
|
||||||
with:
|
with:
|
||||||
name: jan-windows-${{ inputs.new_version }}.exe.sig
|
upload_url: ${{ inputs.upload_url }}
|
||||||
path: |
|
asset_path: ./src-tauri/target/release/bundle/nsis/latest.yml
|
||||||
./src-tauri/target/release/bundle/nsis/*.exe.sig
|
asset_name: latest.yml
|
||||||
|
asset_content_type: text/yaml
|
||||||
|
|
||||||
|
- name: Upload release assert if public provider is github
|
||||||
|
if: inputs.public_provider == 'github'
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
uses: actions/upload-release-asset@v1.0.1
|
||||||
|
with:
|
||||||
|
upload_url: ${{ inputs.upload_url }}
|
||||||
|
asset_path: ./src-tauri/target/release/bundle/nsis/${{ steps.metadata.outputs.FILE_NAME }}
|
||||||
|
asset_name: ${{ steps.metadata.outputs.FILE_NAME }}
|
||||||
|
asset_content_type: application/octet-stream
|
||||||
@ -27,7 +27,9 @@
|
|||||||
"install:cortex:win32": "cd src-tauri/binaries && download.bat",
|
"install:cortex:win32": "cd src-tauri/binaries && download.bat",
|
||||||
"install:cortex": "run-script-os",
|
"install:cortex": "run-script-os",
|
||||||
"dev:tauri": "yarn build:icon && yarn copy:assets:tauri && tauri dev",
|
"dev:tauri": "yarn build:icon && yarn copy:assets:tauri && tauri dev",
|
||||||
"build:tauri": "yarn install:cortex && yarn build:icon && yarn copy:assets:tauri && yarn tauri build --verbose",
|
"build:tauri:linux:win32": "yarn install:cortex && yarn build:icon && yarn copy:assets:tauri && yarn tauri build --verbose",
|
||||||
|
"build:tauri:darwin": "yarn install:cortex && yarn build:icon && yarn copy:assets:tauri && yarn tauri build --verbose --target universal-apple-darwin",
|
||||||
|
"build:tauri": "run-script-os",
|
||||||
"build:icon": "tauri icon ./src-tauri/icons/icon.png",
|
"build:icon": "tauri icon ./src-tauri/icons/icon.png",
|
||||||
"build:server": "cd server && yarn build",
|
"build:server": "cd server && yarn build",
|
||||||
"build:core": "cd core && yarn build && yarn pack",
|
"build:core": "cd core && yarn build && yarn pack",
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "Jan-nightly"
|
name = "Jan"
|
||||||
version = "0.5.16-1320"
|
version = "0.5.16"
|
||||||
description = "Use offline LLMs with your own data. Run open source models like Llama2 or Falcon on your internal computers/servers."
|
description = "Use offline LLMs with your own data. Run open source models like Llama2 or Falcon on your internal computers/servers."
|
||||||
authors = ["Jan <service@jan.ai>"]
|
authors = ["Jan <service@jan.ai>"]
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
|
|||||||
@ -60,6 +60,7 @@ elif [ "$OS_TYPE" == "Darwin" ]; then
|
|||||||
chmod +x "./cortex-server"
|
chmod +x "./cortex-server"
|
||||||
mv ./cortex-server ./cortex-server-universal-apple-darwin
|
mv ./cortex-server ./cortex-server-universal-apple-darwin
|
||||||
cp ./cortex-server-universal-apple-darwin ./cortex-server-aarch64-apple-darwin
|
cp ./cortex-server-universal-apple-darwin ./cortex-server-aarch64-apple-darwin
|
||||||
|
cp ./cortex-server-universal-apple-darwin ./cortex-server-x86_64-apple-darwin
|
||||||
|
|
||||||
# Download engines for macOS
|
# Download engines for macOS
|
||||||
download "${ENGINE_DOWNLOAD_URL}-mac-arm64.tar.gz" "${SHARED_PATH}/engines/cortex.llamacpp/mac-arm64/v${ENGINE_VERSION}"
|
download "${ENGINE_DOWNLOAD_URL}-mac-arm64.tar.gz" "${SHARED_PATH}/engines/cortex.llamacpp/mac-arm64/v${ENGINE_VERSION}"
|
||||||
|
|||||||
23
src-tauri/latest.json.template
Normal file
23
src-tauri/latest.json.template
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
{
|
||||||
|
"version": "",
|
||||||
|
"notes": "",
|
||||||
|
"pub_date": "",
|
||||||
|
"platforms": {
|
||||||
|
"linux-x86_64": {
|
||||||
|
"signature": "",
|
||||||
|
"url": ""
|
||||||
|
},
|
||||||
|
"windows-x86_64": {
|
||||||
|
"signature": "",
|
||||||
|
"url": ""
|
||||||
|
},
|
||||||
|
"darwin-aarch64": {
|
||||||
|
"signature": "",
|
||||||
|
"url": ""
|
||||||
|
},
|
||||||
|
"darwin-x86_64": {
|
||||||
|
"signature": "",
|
||||||
|
"url": ""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,8 +1,8 @@
|
|||||||
{
|
{
|
||||||
"$schema": "https://schema.tauri.app/config/2",
|
"$schema": "https://schema.tauri.app/config/2",
|
||||||
"productName": "Jan-nightly",
|
"productName": "Jan",
|
||||||
"version": "0.5.16-1320",
|
"version": "0.5.16",
|
||||||
"identifier": "jan-nightly.ai.app",
|
"identifier": "jan.ai.app",
|
||||||
"build": {
|
"build": {
|
||||||
"frontendDist": "../web/out",
|
"frontendDist": "../web/out",
|
||||||
"devUrl": "http://localhost:3000",
|
"devUrl": "http://localhost:3000",
|
||||||
@ -47,7 +47,7 @@
|
|||||||
},
|
},
|
||||||
"plugins": {
|
"plugins": {
|
||||||
"updater": {
|
"updater": {
|
||||||
"pubkey": "",
|
"pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IDJFNDEzMEVCMUEzNUFENDQKUldSRXJUVWE2ekJCTGc1Mm1BVXgrWmtES3huUlBFR0lCdG5qbWFvMzgyNDhGN3VTTko5Q1NtTW0K",
|
||||||
"endpoints": [
|
"endpoints": [
|
||||||
"https://github.com/menloresearch/jan/releases/latest/download/latest.json"
|
"https://github.com/menloresearch/jan/releases/latest/download/latest.json"
|
||||||
],
|
],
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user