forked from janhq/jan
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
1,019 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -74,8 +74,8 @@ jobs: | |
new_version: ${{ needs.get-update-version.outputs.new_version }} | ||
beta: true | ||
|
||
combine-latest-mac-yml: | ||
needs: [build-macos-x64, build-macos-arm64, create-draft-release] | ||
combine-beta-mac-yml: | ||
needs: [build-macos-x64, build-macos-arm64, create-draft-release, build-windows-x64, build-linux-x64] | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
|
@@ -86,35 +86,51 @@ jobs: | |
- name: Download mac-x64 artifacts | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: latest-mac-x64 | ||
path: ./latest-mac-x64 | ||
name: beta-mac-x64 | ||
path: ./beta-mac-x64 | ||
- name: Download mac-arm artifacts | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: latest-mac-arm64 | ||
path: ./latest-mac-arm64 | ||
name: beta-mac-arm64 | ||
path: ./beta-mac-arm64 | ||
|
||
- name: 'Merge latest-mac.yml' | ||
- 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 ./latest-mac-x64 | ||
ls -la ./latest-mac-arm64 | ||
ls -la ./beta-mac-x64 | ||
ls -la ./beta-mac-arm64 | ||
ls -la ./electron | ||
cp ./electron/merge-latest-ymls.js /tmp/merge-latest-ymls.js | ||
cp ./electron/merge-latest-ymls.js /tmp/merge-beta-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 | ||
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/[email protected] | ||
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_path: ./beta-mac.yml | ||
asset_name: beta-mac.yml | ||
asset_content_type: text/yaml | ||
overwrite: true | ||
|
||
- name: Upload beta-mac.yml | ||
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: | ||
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" | ||
|
||
- name: set release to prerelease | ||
run: | | ||
gh release edit v${{ needs.create-draft-release.outputs.version }} --draft=false --prerelease | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import React from 'react' | ||
import { render, screen } from '@testing-library/react' | ||
import '@testing-library/jest-dom' | ||
import AutoLink from './index' | ||
|
||
describe('AutoLink Component', () => { | ||
it('renders text without links correctly', () => { | ||
const text = 'This is a test without links.' | ||
render(<AutoLink text={text} />) | ||
expect(screen.getByText(text)).toBeInTheDocument() | ||
}) | ||
|
||
it('renders text with a single link correctly', () => { | ||
const text = 'Check this link: https://example.com' | ||
render(<AutoLink text={text} />) | ||
const link = screen.getByText('https://example.com') | ||
expect(link).toBeInTheDocument() | ||
expect(link).toHaveAttribute('href', 'https://example.com') | ||
expect(link).toHaveAttribute('target', 'blank') | ||
}) | ||
|
||
it('renders text with multiple links correctly', () => { | ||
const text = 'Visit https://example.com and http://test.com' | ||
render(<AutoLink text={text} />) | ||
const link1 = screen.getByText('https://example.com') | ||
const link2 = screen.getByText('http://test.com') | ||
expect(link1).toBeInTheDocument() | ||
expect(link1).toHaveAttribute('href', 'https://example.com') | ||
expect(link1).toHaveAttribute('target', 'blank') | ||
expect(link2).toBeInTheDocument() | ||
expect(link2).toHaveAttribute('href', 'http://test.com') | ||
expect(link2).toHaveAttribute('target', 'blank') | ||
}) | ||
|
||
it('renders text with a link without protocol correctly', () => { | ||
const text = 'Visit example.com for more info.' | ||
render(<AutoLink text={text} />) | ||
const link = screen.getByText('example.com') | ||
expect(link).toBeInTheDocument() | ||
expect(link).toHaveAttribute('href', 'http://example.com') | ||
expect(link).toHaveAttribute('target', 'blank') | ||
}) | ||
}) |
Oops, something went wrong.