Skip to content

Commit

Permalink
Merge pull request #4217 from janhq/dev
Browse files Browse the repository at this point in the history
Hotfix 0.5.11 - Release cut
  • Loading branch information
louis-jan authored Dec 4, 2024
2 parents 7b5f8dd + 38ff118 commit 2ab306e
Show file tree
Hide file tree
Showing 29 changed files with 178 additions and 501 deletions.
64 changes: 7 additions & 57 deletions .github/workflows/jan-electron-build-beta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,8 @@ jobs:
prerelease: false
generate_release_notes: true

build-macos-x64:
uses: ./.github/workflows/template-build-macos-x64.yml
secrets: inherit
needs: [get-update-version]
with:
ref: ${{ github.ref }}
public_provider: github
new_version: ${{ needs.get-update-version.outputs.new_version }}
beta: true

build-macos-arm64:
uses: ./.github/workflows/template-build-macos-arm64.yml
build-macos:
uses: ./.github/workflows/template-build-macos.yml
secrets: inherit
needs: [get-update-version]
with:
Expand Down Expand Up @@ -74,53 +64,14 @@ jobs:
new_version: ${{ needs.get-update-version.outputs.new_version }}
beta: true

combine-beta-mac-yml:
needs: [build-macos-x64, build-macos-arm64, create-draft-release, build-windows-x64, build-linux-x64]
sync-temp-to-latest:
needs: [build-macos, create-draft-release, build-windows-x64, build-linux-x64]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Getting the repo
uses: actions/checkout@v3

- name: Download mac-x64 artifacts
uses: actions/download-artifact@v4
with:
name: beta-mac-x64
path: ./beta-mac-x64
- name: Download mac-arm artifacts
uses: actions/download-artifact@v4
with:
name: beta-mac-arm64
path: ./beta-mac-arm64

- name: 'Merge beta-mac.yml'
# unfortunately electron-builder doesn't understand that we have two different releases for mac-x64 and mac-arm, so we need to manually merge the latest files
# see https://github.com/electron-userland/electron-builder/issues/5592
run: |
ls -la .
ls -la ./beta-mac-x64
ls -la ./beta-mac-arm64
ls -la ./electron
cp ./electron/merge-latest-ymls.js /tmp/merge-beta-ymls.js
npm install js-yaml --prefix /tmp
node /tmp/merge-beta-ymls.js ./beta-mac-x64/beta-mac.yml ./beta-mac-arm64/beta-mac.yml ./beta-mac.yml
cat ./beta-mac.yml
- name: Yet Another Upload Release Asset Action
uses: shogo82148/actions-upload-release-asset@v1.7.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-draft-release.outputs.upload_url }}
asset_path: ./beta-mac.yml
asset_name: beta-mac.yml
asset_content_type: text/yaml
overwrite: true

- name: Upload beta-mac.yml
- name: Sync temp to latest
run: |
aws s3 cp ./beta-mac.yml "s3://${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}/temp-beta/beta-mac.yml"
# sync temp-beta to beta by copy files that are different or new
aws s3 sync "s3://${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}/temp-beta/" "s3://${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}/beta/"
env:
Expand All @@ -136,7 +87,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

noti-discord-and-update-url-readme:
needs: [build-macos-x64, build-macos-arm64, create-draft-release, build-windows-x64, build-linux-x64, combine-beta-mac-yml]
needs: [build-macos, create-draft-release, build-windows-x64, build-linux-x64, sync-temp-to-latest]
runs-on: ubuntu-latest
steps:
- name: Set version to environment variable
Expand All @@ -149,8 +100,7 @@ jobs:
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:
- Windows: https://delta.jan.ai/beta/jan-beta-win-x64-{{ VERSION }}.exe
- macOS Intel: https://delta.jan.ai/beta/jan-beta-mac-x64-{{ VERSION }}.dmg
- macOS Apple Silicon: https://delta.jan.ai/beta/jan-beta-mac-arm64-{{ VERSION }}.dmg
- macOS Universal: https://delta.jan.ai/beta/jan-beta-mac-universal-{{ VERSION }}.dmg
- Linux Deb: https://delta.jan.ai/beta/jan-beta-linux-amd64-{{ VERSION }}.deb
- Linux AppImage: https://delta.jan.ai/beta/jan-beta-linux-x86_64-{{ VERSION }}.AppImage
- Github Release URL: https://github.com/janhq/jan/releases/tag/v{{ VERSION }}
Expand Down
54 changes: 8 additions & 46 deletions .github/workflows/jan-electron-build-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,8 @@ jobs:
get-update-version:
uses: ./.github/workflows/template-get-update-version.yml

build-macos-x64:
uses: ./.github/workflows/template-build-macos-x64.yml
needs: [get-update-version, set-public-provider]
secrets: inherit
with:
ref: ${{ needs.set-public-provider.outputs.ref }}
public_provider: ${{ needs.set-public-provider.outputs.public_provider }}
new_version: ${{ needs.get-update-version.outputs.new_version }}

build-macos-arm64:
uses: ./.github/workflows/template-build-macos-arm64.yml
build-macos:
uses: ./.github/workflows/template-build-macos.yml
needs: [get-update-version, set-public-provider]
secrets: inherit
with:
Expand All @@ -79,42 +70,13 @@ jobs:
public_provider: ${{ needs.set-public-provider.outputs.public_provider }}
new_version: ${{ needs.get-update-version.outputs.new_version }}

combine-latest-mac-yml:
needs: [set-public-provider, build-macos-x64, build-macos-arm64, build-windows-x64, build-linux-x64]
sync-temp-to-latest:
needs: [set-public-provider, build-windows-x64, build-linux-x64, build-macos]
runs-on: ubuntu-latest
steps:
- name: Getting the repo
uses: actions/checkout@v3
with:
ref: ${{ needs.set-public-provider.outputs.ref }}
- name: Download mac-x64 artifacts
uses: actions/download-artifact@v4
with:
name: latest-mac-x64
path: ./latest-mac-x64
- name: Download mac-arm artifacts
uses: actions/download-artifact@v4
with:
name: latest-mac-arm64
path: ./latest-mac-arm64

- name: 'Merge latest-mac.yml'
# unfortunately electron-builder doesn't understand that we have two different releases for mac-x64 and mac-arm, so we need to manually merge the latest files
# see https://github.com/electron-userland/electron-builder/issues/5592
run: |
ls -la .
ls -la ./latest-mac-x64
ls -la ./latest-mac-arm64
ls -la ./electron
cp ./electron/merge-latest-ymls.js /tmp/merge-latest-ymls.js
npm install js-yaml --prefix /tmp
node /tmp/merge-latest-ymls.js ./latest-mac-x64/latest-mac.yml ./latest-mac-arm64/latest-mac.yml ./latest-mac.yml
cat ./latest-mac.yml
- name: Upload latest-mac.yml
- name: Sync temp to latest
if: ${{ needs.set-public-provider.outputs.public_provider == 'aws-s3' }}
run: |
aws s3 cp ./latest-mac.yml "s3://${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}/temp-nightly/latest-mac.yml"
aws s3 sync s3://${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}/temp-nightly/ s3://${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}/nightly/
env:
AWS_ACCESS_KEY_ID: ${{ secrets.DELTA_AWS_ACCESS_KEY_ID }}
Expand All @@ -123,7 +85,7 @@ jobs:
AWS_EC2_METADATA_DISABLED: "true"

noti-discord-nightly-and-update-url-readme:
needs: [build-macos-x64, build-macos-arm64, build-windows-x64, build-linux-x64, get-update-version, set-public-provider, combine-latest-mac-yml]
needs: [build-macos, build-windows-x64, build-linux-x64, get-update-version, set-public-provider, sync-temp-to-latest]
secrets: inherit
if: github.event_name == 'schedule'
uses: ./.github/workflows/template-noti-discord-and-update-url-readme.yml
Expand All @@ -134,7 +96,7 @@ jobs:
new_version: ${{ needs.get-update-version.outputs.new_version }}

noti-discord-pre-release-and-update-url-readme:
needs: [build-macos-x64, build-macos-arm64, build-windows-x64, build-linux-x64, get-update-version, set-public-provider, combine-latest-mac-yml]
needs: [build-macos, build-windows-x64, build-linux-x64, get-update-version, set-public-provider, sync-temp-to-latest]
secrets: inherit
if: github.event_name == 'push'
uses: ./.github/workflows/template-noti-discord-and-update-url-readme.yml
Expand All @@ -145,7 +107,7 @@ jobs:
new_version: ${{ needs.get-update-version.outputs.new_version }}

noti-discord-manual-and-update-url-readme:
needs: [build-macos-x64, build-macos-arm64, build-windows-x64, build-linux-x64, get-update-version, set-public-provider, combine-latest-mac-yml]
needs: [build-macos, build-windows-x64, build-linux-x64, get-update-version, set-public-provider, sync-temp-to-latest]
secrets: inherit
if: github.event_name == 'workflow_dispatch' && github.event.inputs.public_provider == 'aws-s3'
uses: ./.github/workflows/template-noti-discord-and-update-url-readme.yml
Expand Down
59 changes: 3 additions & 56 deletions .github/workflows/jan-electron-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,8 @@ jobs:
draft: true
prerelease: false

build-macos-x64:
uses: ./.github/workflows/template-build-macos-x64.yml
secrets: inherit
needs: [get-update-version]
with:
ref: ${{ github.ref }}
public_provider: github
new_version: ${{ needs.get-update-version.outputs.new_version }}

build-macos-arm64:
uses: ./.github/workflows/template-build-macos-arm64.yml
build-macos:
uses: ./.github/workflows/template-build-macos.yml
secrets: inherit
needs: [get-update-version]
with:
Expand All @@ -69,52 +60,8 @@ jobs:
public_provider: github
new_version: ${{ needs.get-update-version.outputs.new_version }}

combine-latest-mac-yml:
needs: [build-macos-x64, build-macos-arm64, create-draft-release]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Getting the repo
uses: actions/checkout@v3

- name: Download mac-x64 artifacts
uses: actions/download-artifact@v4
with:
name: latest-mac-x64
path: ./latest-mac-x64
- name: Download mac-arm artifacts
uses: actions/download-artifact@v4
with:
name: latest-mac-arm64
path: ./latest-mac-arm64

- name: 'Merge latest-mac.yml'
# unfortunately electron-builder doesn't understand that we have two different releases for mac-x64 and mac-arm, so we need to manually merge the latest files
# see https://github.com/electron-userland/electron-builder/issues/5592
run: |
ls -la .
ls -la ./latest-mac-x64
ls -la ./latest-mac-arm64
ls -la ./electron
cp ./electron/merge-latest-ymls.js /tmp/merge-latest-ymls.js
npm install js-yaml --prefix /tmp
node /tmp/merge-latest-ymls.js ./latest-mac-x64/latest-mac.yml ./latest-mac-arm64/latest-mac.yml ./latest-mac.yml
cat ./latest-mac.yml
- name: Yet Another Upload Release Asset Action
uses: shogo82148/actions-upload-release-asset@v1.7.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-draft-release.outputs.upload_url }}
asset_path: ./latest-mac.yml
asset_name: latest-mac.yml
asset_content_type: text/yaml
overwrite: true

update_release_draft:
needs: [build-macos-x64, build-macos-arm64, build-windows-x64, build-linux-x64, combine-latest-mac-yml]
needs: [build-macos, build-windows-x64, build-linux-x64]
permissions:
# write permission is required to create a github release
contents: write
Expand Down
Loading

0 comments on commit 2ab306e

Please sign in to comment.