diff --git a/.github/workflows/jan-electron-build-beta.yml b/.github/workflows/jan-electron-build-beta.yml deleted file mode 100644 index 61ff717ac..000000000 --- a/.github/workflows/jan-electron-build-beta.yml +++ /dev/null @@ -1,86 +0,0 @@ -name: Electron Builder - Beta Build - -on: - push: - tags: ["v[0-9]+.[0-9]+.[0-9]+-rc[0-9]+-beta"] - -jobs: - # Job create Update app version based on latest release tag with build number and save to output - get-update-version: - uses: ./.github/workflows/template-get-update-version.yml - - build-macos: - uses: ./.github/workflows/template-build-macos.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 - nightly: false - cortex_api_port: "39271" - - build-windows-x64: - uses: ./.github/workflows/template-build-windows-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 - nightly: false - cortex_api_port: "39271" - - build-linux-x64: - uses: ./.github/workflows/template-build-linux-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 - nightly: false - cortex_api_port: "39271" - - sync-temp-to-latest: - needs: [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: Sync temp to latest - run: | - # 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" - - noti-discord-and-update-url-readme: - needs: [build-macos, get-update-version, build-windows-x64, build-linux-x64, sync-temp-to-latest] - runs-on: ubuntu-latest - steps: - - name: Set version to environment variable - run: | - VERSION=${{ needs.get-update-version.outputs.new_version }} - VERSION="${VERSION#v}" - echo "VERSION=$VERSION" >> $GITHUB_ENV - - - name: Notify Discord - uses: Ilshidur/action-discord@master - with: - 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 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 - env: - DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK_JAN_BETA }} \ No newline at end of file diff --git a/.github/workflows/jan-electron-build.yml b/.github/workflows/jan-electron-build.yml deleted file mode 100644 index 7d69a5c12..000000000 --- a/.github/workflows/jan-electron-build.yml +++ /dev/null @@ -1,91 +0,0 @@ -name: Electron Builder - Tag - -on: - push: - tags: ["v[0-9]+.[0-9]+.[0-9]+"] - -jobs: - # Job create Update app version based on latest release tag with build number and save to output - get-update-version: - uses: ./.github/workflows/template-get-update-version.yml - - create-draft-release: - runs-on: ubuntu-latest - if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') - outputs: - upload_url: ${{ steps.create_release.outputs.upload_url }} - version: ${{ steps.get_version.outputs.version }} - permissions: - contents: write - steps: - - name: Extract tag name without v prefix - id: get_version - run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV && echo "::set-output name=version::${GITHUB_REF#refs/tags/v}" - env: - GITHUB_REF: ${{ github.ref }} - - name: Create Draft Release - id: create_release - uses: softprops/action-gh-release@v2 - with: - tag_name: ${{ github.ref_name }} - token: ${{ secrets.GITHUB_TOKEN }} - name: "${{ env.VERSION }}" - draft: true - prerelease: false - - build-macos: - uses: ./.github/workflows/template-build-macos.yml - secrets: inherit - needs: [get-update-version] - with: - ref: ${{ github.ref }} - public_provider: github - beta: false - nightly: false - new_version: ${{ needs.get-update-version.outputs.new_version }} - - build-windows-x64: - uses: ./.github/workflows/template-build-windows-x64.yml - secrets: inherit - needs: [get-update-version] - with: - ref: ${{ github.ref }} - public_provider: github - beta: false - nightly: false - new_version: ${{ needs.get-update-version.outputs.new_version }} - - build-linux-x64: - uses: ./.github/workflows/template-build-linux-x64.yml - secrets: inherit - needs: [get-update-version] - with: - ref: ${{ github.ref }} - public_provider: github - beta: false - nightly: false - new_version: ${{ needs.get-update-version.outputs.new_version }} - - update_release_draft: - needs: [build-macos, build-windows-x64, build-linux-x64] - permissions: - # write permission is required to create a github release - contents: write - # write permission is required for autolabeler - # otherwise, read permission is required at least - pull-requests: write - runs-on: ubuntu-latest - steps: - # (Optional) GitHub Enterprise requires GHE_HOST variable set - #- name: Set GHE_HOST - # run: | - # echo "GHE_HOST=${GITHUB_SERVER_URL##https:\/\/}" >> $GITHUB_ENV - - # Drafts your next Release notes as Pull Requests are merged into "master" - - uses: release-drafter/release-drafter@v5 - # (Optional) specify config name to use, relative to .github/. Default: release-drafter.yml - # with: - # config-name: my-config.yml - # disable-autolabeler: true - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/jan-tauri-build-beta.yml b/.github/workflows/jan-tauri-build-beta.yml index 1f4239381..476293d71 100644 --- a/.github/workflows/jan-tauri-build-beta.yml +++ b/.github/workflows/jan-tauri-build-beta.yml @@ -8,42 +8,69 @@ jobs: # Job create Update app version based on latest release tag with build number and save to output get-update-version: uses: ./.github/workflows/template-get-update-version.yml + create-draft-release: + runs-on: ubuntu-latest + if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') + outputs: + upload_url: ${{ steps.create_release.outputs.upload_url }} + version: ${{ steps.get_version.outputs.version }} + permissions: + contents: write + steps: + - name: Extract tag name without v prefix + id: get_version + run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV && echo "::set-output name=version::${GITHUB_REF#refs/tags/v}" + env: + GITHUB_REF: ${{ github.ref }} + - name: Create Draft Release + id: create_release + uses: softprops/action-gh-release@v2 + with: + tag_name: ${{ github.ref_name }} + token: ${{ secrets.GITHUB_TOKEN }} + name: "${{ env.VERSION }}" + draft: true + prerelease: false + generate_release_notes: true build-macos: uses: ./.github/workflows/template-tauri-build-macos.yml secrets: inherit - needs: [get-update-version] + needs: [get-update-version, create-draft-release] with: ref: ${{ github.ref }} public_provider: github new_version: ${{ needs.get-update-version.outputs.new_version }} channel: beta cortex_api_port: "39271" + upload_url: ${{ needs.create-draft-release.outputs.upload_url }} build-windows-x64: uses: ./.github/workflows/template-tauri-build-windows-x64.yml secrets: inherit - needs: [get-update-version] + needs: [get-update-version, create-draft-release] with: ref: ${{ github.ref }} public_provider: github new_version: ${{ needs.get-update-version.outputs.new_version }} channel: beta cortex_api_port: "39271" + upload_url: ${{ needs.create-draft-release.outputs.upload_url }} build-linux-x64: uses: ./.github/workflows/template-tauri-build-linux-x64.yml secrets: inherit - needs: [get-update-version] + needs: [get-update-version, create-draft-release] with: ref: ${{ github.ref }} public_provider: github new_version: ${{ needs.get-update-version.outputs.new_version }} channel: beta cortex_api_port: "39271" + upload_url: ${{ needs.create-draft-release.outputs.upload_url }} sync-temp-to-latest: - needs: [get-update-version, build-macos, build-windows-x64, build-linux-x64] + needs: [create-draft-release, get-update-version, build-macos, build-windows-x64, build-linux-x64] runs-on: ubuntu-latest permissions: contents: write @@ -96,6 +123,16 @@ jobs: AWS_DEFAULT_REGION: ${{ secrets.DELTA_AWS_REGION }} AWS_EC2_METADATA_DISABLED: "true" + - name: Upload release assert if public provider is github + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + uses: actions/upload-release-asset@v1.0.1 + with: + upload_url: ${{ needs.create-draft-release.outputs.upload_url }} + asset_path: ./latest.json + asset_name: latest.json + asset_content_type: text/json + noti-discord-and-update-url-readme: needs: [build-macos, get-update-version, build-windows-x64, build-linux-x64, sync-temp-to-latest] runs-on: ubuntu-latest diff --git a/.github/workflows/jan-tauri-build.yml b/.github/workflows/jan-tauri-build.yml index 50236776b..1dc22f2e4 100644 --- a/.github/workflows/jan-tauri-build.yml +++ b/.github/workflows/jan-tauri-build.yml @@ -1,4 +1,4 @@ -name: Electron Builder - Tag +name: Tauri Builder - Tag on: push: @@ -36,35 +36,38 @@ jobs: build-macos: uses: ./.github/workflows/template-tauri-build-macos.yml secrets: inherit - needs: [get-update-version] + needs: [get-update-version, create-draft-release] with: ref: ${{ github.ref }} public_provider: github channel: stable new_version: ${{ needs.get-update-version.outputs.new_version }} + upload_url: ${{ needs.create-draft-release.outputs.upload_url }} build-windows-x64: uses: ./.github/workflows/template-tauri-build-windows-x64.yml secrets: inherit - needs: [get-update-version] + needs: [get-update-version, create-draft-release] with: ref: ${{ github.ref }} public_provider: github channel: stable new_version: ${{ needs.get-update-version.outputs.new_version }} + upload_url: ${{ needs.create-draft-release.outputs.upload_url }} build-linux-x64: uses: ./.github/workflows/template-tauri-build-linux-x64.yml secrets: inherit - needs: [get-update-version] + needs: [get-update-version, create-draft-release] with: ref: ${{ github.ref }} public_provider: github channel: stable new_version: ${{ needs.get-update-version.outputs.new_version }} + upload_url: ${{ needs.create-draft-release.outputs.upload_url }} sync-temp-to-latest: - needs: [get-update-version, build-macos, build-windows-x64, build-linux-x64] + needs: [create-draft-release, get-update-version, build-macos, build-windows-x64, build-linux-x64] runs-on: ubuntu-latest permissions: contents: write @@ -106,16 +109,16 @@ jobs: | .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/" + + - name: Upload release assert if public provider is github 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" + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + uses: actions/upload-release-asset@v1.0.1 + with: + upload_url: ${{ needs.create-draft-release.outputs.upload_url }} + asset_path: ./latest.json + asset_name: latest.json + asset_content_type: text/json update_release_draft: needs: [build-macos, build-windows-x64, build-linux-x64] diff --git a/.github/workflows/nightly-integrate-cortex-cpp.yml b/.github/workflows/nightly-integrate-cortex-cpp.yml deleted file mode 100644 index 066fbd28e..000000000 --- a/.github/workflows/nightly-integrate-cortex-cpp.yml +++ /dev/null @@ -1,127 +0,0 @@ -name: Nightly Update cortex cpp - -on: - schedule: - - cron: '30 19 * * 1-5' # At 01:30 on every day-of-week from Monday through Friday UTC +7 - workflow_dispatch: - -jobs: - update-submodule: - runs-on: ubuntu-latest - permissions: - contents: write - pull-requests: write - actions: write - - outputs: - pr_number: ${{ steps.check-update.outputs.pr_number }} - pr_created: ${{ steps.check-update.outputs.pr_created }} - - steps: - - name: Checkout repository - uses: actions/checkout@v3 - with: - submodules: recursive - ref: dev - fetch-depth: 0 - token: ${{ secrets.PAT_SERVICE_ACCOUNT }} - - - name: Configure Git - run: | - git config --global user.name 'github-actions[bot]' - git config --global user.email 'github-actions[bot]@users.noreply.github.com' - - - name: Update submodule to latest release - id: check-update - env: - GITHUB_TOKEN: ${{ secrets.PAT_SERVICE_ACCOUNT }} - run: | - curl -s https://api.github.com/repos/menloresearch/cortex/releases > /tmp/github_api_releases.json - latest_prerelease_name=$(cat /tmp/github_api_releases.json | jq -r '.[] | select(.prerelease) | .name' | head -n 1) - - get_asset_count() { - local version_name=$1 - cat /tmp/github_api_releases.json | jq -r --arg version_name "$version_name" '.[] | select(.name == $version_name) | .assets | length' - } - - cortex_cpp_version_file_path="extensions/inference-nitro-extension/bin/version.txt" - current_version_name=$(cat "$cortex_cpp_version_file_path" | head -n 1) - - current_version_asset_count=$(get_asset_count "$current_version_name") - latest_prerelease_asset_count=$(get_asset_count "$latest_prerelease_name") - - if [ "$current_version_name" = "$latest_prerelease_name" ]; then - echo "cortex cpp remote repo doesn't have update today, skip update cortex.cpp for today nightly build" - echo "::set-output name=pr_created::false" - exit 0 - fi - - if [ "$current_version_asset_count" != "$latest_prerelease_asset_count" ]; then - echo "Latest prerelease version has different number of assets, somethink went wrong, skip update cortex.cpp for today nightly build" - echo "::set-output name=pr_created::false" - exit 1 - fi - - echo $latest_prerelease_name > $cortex_cpp_version_file_path - echo "Updated version from $current_version_name to $latest_prerelease_name." - echo "::set-output name=pr_created::true" - - git add -f $cortex_cpp_version_file_path - git commit -m "Update cortex cpp nightly to version $latest_prerelease_name" - branch_name="update-nightly-$(date +'%Y-%m-%d-%H-%M')" - git checkout -b $branch_name - git push origin $branch_name - - pr_title="Update cortex cpp nightly to version $latest_prerelease_name" - pr_body="This PR updates the Update cortex cpp nightly to version $latest_prerelease_name" - - gh pr create --title "$pr_title" --body "$pr_body" --head $branch_name --base dev --reviewer Van-QA - - pr_number=$(gh pr list --head $branch_name --json number --jq '.[0].number') - echo "::set-output name=pr_number::$pr_number" - - check-and-merge-pr: - needs: update-submodule - if: needs.update-submodule.outputs.pr_created == 'true' - runs-on: ubuntu-latest - permissions: - contents: write - pull-requests: write - - steps: - - name: Checkout repository - uses: actions/checkout@v3 - with: - submodules: recursive - fetch-depth: 0 - token: ${{ secrets.PAT_SERVICE_ACCOUNT }} - - - name: Wait for CI to pass - env: - GITHUB_TOKEN: ${{ secrets.PAT_SERVICE_ACCOUNT }} - run: | - pr_number=${{ needs.update-submodule.outputs.pr_number }} - while true; do - ci_completed=$(gh pr checks $pr_number --json completedAt --jq '.[].completedAt') - if echo "$ci_completed" | grep -q "0001-01-01T00:00:00Z"; then - echo "CI is still running, waiting..." - sleep 60 - else - echo "CI has completed, checking states..." - ci_states=$(gh pr checks $pr_number --json state --jq '.[].state') - if echo "$ci_states" | grep -vqE "SUCCESS|SKIPPED"; then - echo "CI failed, exiting..." - exit 1 - else - echo "CI passed, merging PR..." - break - fi - fi - done - - - name: Merge the PR - env: - GITHUB_TOKEN: ${{ secrets.PAT_SERVICE_ACCOUNT }} - run: | - pr_number=${{ needs.update-submodule.outputs.pr_number }} - gh pr merge $pr_number --merge --admin diff --git a/.github/workflows/template-build-linux-x64.yml b/.github/workflows/template-build-linux-x64.yml deleted file mode 100644 index 58b566931..000000000 --- a/.github/workflows/template-build-linux-x64.yml +++ /dev/null @@ -1,187 +0,0 @@ -name: build-linux-x64 -on: - workflow_call: - inputs: - ref: - required: true - type: string - default: 'refs/heads/main' - public_provider: - required: true - type: string - default: none - description: 'none: build only, github: build and publish to github, aws s3: build and publish to aws s3' - new_version: - required: true - type: string - 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: - required: false - type: string - default: null - secrets: - DELTA_AWS_S3_BUCKET_NAME: - required: false - DELTA_AWS_ACCESS_KEY_ID: - required: false - DELTA_AWS_SECRET_ACCESS_KEY: - required: false - -jobs: - build-linux-x64: - runs-on: ubuntu-latest - environment: production - permissions: - contents: write - steps: - - name: Getting the repo - uses: actions/checkout@v3 - with: - ref: ${{ inputs.ref }} - - - name: Replace Icons for Beta Build - if: inputs.beta == true && inputs.nightly != true - shell: bash - run: | - 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 - uses: actions/setup-node@v1 - with: - node-version: 20 - - - name: Install jq - uses: dcarbone/install-jq-action@v2.0.1 - - - name: Update app version base public_provider - if: inputs.public_provider != 'github' - run: | - echo "Version: ${{ inputs.new_version }}" - # Update the version in electron/package.json - jq --arg version "${{ inputs.new_version }}" '.version = $version' electron/package.json > /tmp/package.json - mv /tmp/package.json electron/package.json - jq --arg version "${{ inputs.new_version }}" '.version = $version' web/package.json > /tmp/package.json - mv /tmp/package.json web/package.json - jq '.build.publish = [{"provider": "generic", "url": "https://delta.jan.ai/nightly", "channel": "latest"}, {"provider": "s3", "acl": null, "bucket": "${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}", "region": "${{ secrets.DELTA_AWS_REGION}}", "path": "temp-nightly", "channel": "latest"}]' electron/package.json > /tmp/package.json - mv /tmp/package.json electron/package.json - cat electron/package.json - chmod +x .github/scripts/rename-app.sh - .github/scripts/rename-app.sh ./electron/package.json nightly - chmod +x .github/scripts/rename-workspace.sh - .github/scripts/rename-workspace.sh ./package.json nightly - echo "------------------------" - cat ./electron/package.json - echo "------------------------" - - - name: Change App Name for beta version - if: inputs.beta == true - shell: bash - run: | - chmod +x .github/scripts/rename-app.sh - .github/scripts/rename-app.sh ./electron/package.json beta - chmod +x .github/scripts/rename-workspace.sh - .github/scripts/rename-workspace.sh ./package.json beta - echo "------------------------" - cat ./electron/package.json - echo "------------------------" - cat ./package.json - jq '.build.publish = [{"provider": "generic", "url": "https://delta.jan.ai/beta", "channel": "beta"}, {"provider": "s3", "acl": null, "bucket": "${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}", "region": "${{ secrets.DELTA_AWS_REGION}}", "path": "temp-beta", "channel": "beta"}]' electron/package.json > /tmp/package.json - mv /tmp/package.json electron/package.json - cat electron/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' electron/package.json > /tmp/package.json - mv /tmp/package.json electron/package.json - 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 }} - - - name: Build and publish app to aws s3 r2 or github artifactory - if: inputs.public_provider != 'github' - run: | - # check public_provider is true or not - echo "public_provider is ${{ inputs.public_provider }}" - if [ "${{ inputs.public_provider }}" == "none" ]; then - make build - else - make build-and-publish - fi - env: - 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_HOST: ${{ secrets.POSTHOG_HOST }} - CORTEX_API_PORT: ${{ inputs.cortex_api_port }} - - - name: Build and publish app to github - if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') && inputs.public_provider == 'github' && inputs.beta == false - run: | - make build-and-publish - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - POSTHOG_KEY: ${{ secrets.POSTHOG_KEY }} - POSTHOG_HOST: ${{ secrets.POSTHOG_HOST }} - - - name: Build and publish app to github - if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') && inputs.public_provider == 'github' && inputs.beta == true - run: | - make build-and-publish - env: - 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_HOST: ${{ secrets.POSTHOG_HOST }} - - - name: Upload Artifact .deb file - if: inputs.public_provider != 'github' - uses: actions/upload-artifact@v4 - with: - name: jan-linux-amd64-${{ inputs.new_version }}-deb - path: ./electron/dist/*.deb - - - name: Upload Artifact .AppImage file - if: inputs.public_provider != 'github' - uses: actions/upload-artifact@v4 - with: - name: jan-linux-amd64-${{ inputs.new_version }}-AppImage - path: ./electron/dist/*.AppImage \ No newline at end of file diff --git a/.github/workflows/template-build-macos.yml b/.github/workflows/template-build-macos.yml deleted file mode 100644 index a5e5cc724..000000000 --- a/.github/workflows/template-build-macos.yml +++ /dev/null @@ -1,233 +0,0 @@ -name: build-macos -on: - workflow_call: - inputs: - ref: - required: true - type: string - default: 'refs/heads/main' - public_provider: - required: true - type: string - default: none - description: 'none: build only, github: build and publish to github, aws s3: build and publish to aws s3' - new_version: - required: true - type: string - 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: - required: false - type: string - default: null - secrets: - DELTA_AWS_S3_BUCKET_NAME: - required: false - DELTA_AWS_ACCESS_KEY_ID: - required: false - DELTA_AWS_SECRET_ACCESS_KEY: - required: false - CODE_SIGN_P12_BASE64: - required: false - CODE_SIGN_P12_PASSWORD: - required: false - APPLE_ID: - required: false - APPLE_APP_SPECIFIC_PASSWORD: - required: false - DEVELOPER_ID: - required: false - -jobs: - build-macos: - runs-on: macos-latest - environment: production - permissions: - contents: write - steps: - - name: Getting the repo - uses: actions/checkout@v3 - with: - ref: ${{ inputs.ref }} - - - name: Replace Icons for Beta Build - if: inputs.beta == true && inputs.nightly != true - shell: bash - run: | - 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 - uses: actions/setup-node@v1 - with: - node-version: 20 - - - name: Install jq - uses: dcarbone/install-jq-action@v2.0.1 - - - name: Update app version based on latest release tag with build number - if: inputs.public_provider != 'github' - run: | - echo "Version: ${{ inputs.new_version }}" - # Update the version in electron/package.json - jq --arg version "${{ inputs.new_version }}" '.version = $version' electron/package.json > /tmp/package.json - mv /tmp/package.json electron/package.json - - jq --arg version "${{ inputs.new_version }}" '.version = $version' web/package.json > /tmp/package.json - mv /tmp/package.json web/package.json - - jq '.build.publish = [{"provider": "generic", "url": "https://delta.jan.ai/nightly", "channel": "latest"}, {"provider": "s3", "acl": null, "bucket": "${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}", "region": "${{ secrets.DELTA_AWS_REGION}}", "path": "temp-nightly", "channel": "latest"}]' electron/package.json > /tmp/package.json - mv /tmp/package.json electron/package.json - - jq --arg teamid "${{ secrets.APPLE_TEAM_ID }}" '.build.mac.notarize.teamId = $teamid' electron/package.json > /tmp/package.json - mv /tmp/package.json electron/package.json - - # cat electron/package.json - chmod +x .github/scripts/rename-app.sh - .github/scripts/rename-app.sh ./electron/package.json nightly - chmod +x .github/scripts/rename-workspace.sh - .github/scripts/rename-workspace.sh ./package.json nightly - echo "------------------------" - cat ./electron/package.json - echo "------------------------" - - - name: Change App Name for beta version - if: inputs.beta == true - shell: bash - run: | - chmod +x .github/scripts/rename-app.sh - .github/scripts/rename-app.sh ./electron/package.json beta - chmod +x .github/scripts/rename-workspace.sh - .github/scripts/rename-workspace.sh ./package.json beta - echo "------------------------" - cat ./electron/package.json - echo "------------------------" - cat ./package.json - jq '.build.publish = [{"provider": "generic", "url": "https://delta.jan.ai/beta", "channel": "beta"}, {"provider": "s3", "acl": null, "bucket": "${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}", "region": "${{ secrets.DELTA_AWS_REGION}}", "path": "temp-beta", "channel": "beta"}]' electron/package.json > /tmp/package.json - mv /tmp/package.json electron/package.json - cat electron/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' electron/package.json > /tmp/package.json - mv /tmp/package.json electron/package.json - jq --arg version "${VERSION_TAG#v}" '.version = $version' web/package.json > /tmp/package.json - mv /tmp/package.json web/package.json - jq --arg teamid "${{ secrets.APPLE_TEAM_ID }}" '.build.mac.notarize.teamId = $teamid' electron/package.json > /tmp/package.json - mv /tmp/package.json electron/package.json - cat electron/package.json - env: - VERSION_TAG: ${{ inputs.new_version }} - - - name: Get Cer for code signing - run: base64 -d <<< "$CODE_SIGN_P12_BASE64" > /tmp/codesign.p12 - shell: bash - env: - CODE_SIGN_P12_BASE64: ${{ secrets.CODE_SIGN_P12_BASE64 }} - - - uses: apple-actions/import-codesign-certs@v2 - continue-on-error: true - with: - p12-file-base64: ${{ secrets.CODE_SIGN_P12_BASE64 }} - p12-password: ${{ secrets.CODE_SIGN_P12_PASSWORD }} - - - name: Build and publish app to aws s3 r2 or github artifactory - if: inputs.public_provider != 'github' - run: | - # check public_provider is true or not - echo "public_provider is ${{ inputs.public_provider }}" - if [ "${{ inputs.public_provider }}" == "none" ]; then - make build - else - make build-and-publish - fi - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - CSC_LINK: '/tmp/codesign.p12' - CSC_KEY_PASSWORD: ${{ secrets.CODE_SIGN_P12_PASSWORD }} - CSC_IDENTITY_AUTO_DISCOVERY: 'true' - APPLE_ID: ${{ secrets.APPLE_ID }} - APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_APP_SPECIFIC_PASSWORD }} - APP_PATH: '.' - DEVELOPER_ID: ${{ secrets.DEVELOPER_ID }} - AWS_ACCESS_KEY_ID: ${{ secrets.DELTA_AWS_ACCESS_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.DELTA_AWS_SECRET_ACCESS_KEY }} - AWS_DEFAULT_REGION: auto - AWS_EC2_METADATA_DISABLED: 'true' - AWS_MAX_ATTEMPTS: '5' - POSTHOG_KEY: ${{ secrets.POSTHOG_KEY }} - POSTHOG_HOST: ${{ secrets.POSTHOG_HOST }} - CORTEX_API_PORT: ${{ inputs.cortex_api_port }} - - - name: Build and publish app to github - if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') && inputs.public_provider == 'github' && inputs.beta == false - run: | - make build-and-publish - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - CSC_LINK: '/tmp/codesign.p12' - CSC_KEY_PASSWORD: ${{ secrets.CODE_SIGN_P12_PASSWORD }} - CSC_IDENTITY_AUTO_DISCOVERY: 'true' - APPLE_ID: ${{ secrets.APPLE_ID }} - APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_APP_SPECIFIC_PASSWORD }} - APP_PATH: '.' - DEVELOPER_ID: ${{ secrets.DEVELOPER_ID }} - POSTHOG_KEY: ${{ secrets.POSTHOG_KEY }} - POSTHOG_HOST: ${{ secrets.POSTHOG_HOST }} - - - name: Build and publish app to github - if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') && inputs.public_provider == 'github' && inputs.beta == true - run: | - make build-and-publish - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - CSC_LINK: '/tmp/codesign.p12' - CSC_KEY_PASSWORD: ${{ secrets.CODE_SIGN_P12_PASSWORD }} - CSC_IDENTITY_AUTO_DISCOVERY: 'true' - APPLE_ID: ${{ secrets.APPLE_ID }} - APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_APP_SPECIFIC_PASSWORD }} - APP_PATH: '.' - DEVELOPER_ID: ${{ secrets.DEVELOPER_ID }} - AWS_ACCESS_KEY_ID: ${{ secrets.DELTA_AWS_ACCESS_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.DELTA_AWS_SECRET_ACCESS_KEY }} - AWS_DEFAULT_REGION: auto - AWS_EC2_METADATA_DISABLED: 'true' - AWS_MAX_ATTEMPTS: '5' - POSTHOG_KEY: ${{ secrets.POSTHOG_KEY }} - POSTHOG_HOST: ${{ secrets.POSTHOG_HOST }} - - - name: Upload Artifact - if: inputs.public_provider != 'github' - uses: actions/upload-artifact@v4 - with: - name: jan-mac-universal-${{ inputs.new_version }} - path: ./electron/dist/*.dmg \ No newline at end of file diff --git a/.github/workflows/template-build-windows-x64.yml b/.github/workflows/template-build-windows-x64.yml deleted file mode 100644 index 9be028e15..000000000 --- a/.github/workflows/template-build-windows-x64.yml +++ /dev/null @@ -1,229 +0,0 @@ -name: build-windows-x64 -on: - workflow_call: - inputs: - ref: - required: true - type: string - default: 'refs/heads/main' - public_provider: - required: true - type: string - default: none - description: 'none: build only, github: build and publish to github, aws s3: build and publish to aws s3' - new_version: - required: true - type: string - 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: - required: false - type: string - default: null - secrets: - DELTA_AWS_S3_BUCKET_NAME: - required: false - DELTA_AWS_ACCESS_KEY_ID: - required: false - DELTA_AWS_SECRET_ACCESS_KEY: - required: false - AZURE_KEY_VAULT_URI: - required: false - AZURE_CLIENT_ID: - required: false - AZURE_TENANT_ID: - required: false - AZURE_CLIENT_SECRET: - required: false - AZURE_CERT_NAME: - required: false - -jobs: - build-windows-x64: - runs-on: windows-latest - permissions: - contents: write - steps: - - name: Getting the repo - uses: actions/checkout@v3 - with: - ref: ${{ inputs.ref }} - - - name: Replace Icons for Beta Build - if: inputs.beta == true && inputs.nightly != true - shell: bash - run: | - 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 - uses: actions/setup-node@v1 - with: - node-version: 20 - - - name: Install jq - uses: dcarbone/install-jq-action@v2.0.1 - - - name: Update app version base on tag - if: inputs.public_provider != 'github' - id: version_update - shell: bash - run: | - echo "Version: ${{ inputs.new_version }}" - # Update the version in electron/package.json - jq --arg version "${{ inputs.new_version }}" '.version = $version' electron/package.json > /tmp/package.json - mv /tmp/package.json electron/package.json - - jq --arg version "${{ inputs.new_version }}" '.version = $version' web/package.json > /tmp/package.json - mv /tmp/package.json web/package.json - - jq '.build.publish = [{"provider": "generic", "url": "https://delta.jan.ai/nightly", "channel": "latest"}, {"provider": "s3", "acl": null, "bucket": "${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}", "region": "${{ secrets.DELTA_AWS_REGION}}", "path": "temp-nightly", "channel": "latest"}]' electron/package.json > /tmp/package.json - mv /tmp/package.json electron/package.json - - jq '.build.win.sign = "./sign.js"' electron/package.json > /tmp/package.json - mv /tmp/package.json electron/package.json - cat electron/package.json - - chmod +x .github/scripts/rename-app.sh - .github/scripts/rename-app.sh ./electron/package.json nightly - chmod +x .github/scripts/rename-workspace.sh - .github/scripts/rename-workspace.sh ./package.json nightly - chmod +x .github/scripts/rename-uninstaller.sh - .github/scripts/rename-uninstaller.sh nightly - echo "------------------------" - cat ./electron/package.json - echo "------------------------" - cat ./package.json - echo "------------------------" - - - name: Change App Name for beta version - if: inputs.beta == true - shell: bash - run: | - chmod +x .github/scripts/rename-app.sh - .github/scripts/rename-app.sh ./electron/package.json beta - 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 ./electron/package.json - echo "------------------------" - cat ./package.json - echo "------------------------" - cat ./electron/scripts/uninstaller.nsh - jq '.build.publish = [{"provider": "generic", "url": "https://delta.jan.ai/beta", "channel": "beta"}, {"provider": "s3", "acl": null, "bucket": "${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}", "region": "${{ secrets.DELTA_AWS_REGION}}", "path": "temp-beta", "channel": "beta"}]' electron/package.json > /tmp/package.json - mv /tmp/package.json electron/package.json - cat electron/package.json - - - name: Update app version base on tag - if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') && inputs.public_provider == 'github' - shell: bash - run: | - jq --arg version "${VERSION_TAG#v}" '.version = $version' electron/package.json > /tmp/package.json - mv /tmp/package.json electron/package.json - jq --arg version "${VERSION_TAG#v}" '.version = $version' web/package.json > /tmp/package.json - mv /tmp/package.json web/package.json - jq '.build.win.sign = "./sign.js"' electron/package.json > /tmp/package.json - mv /tmp/package.json electron/package.json - env: - VERSION_TAG: ${{ inputs.new_version }} - - - name: Install AzureSignTool - run: | - dotnet tool install --global AzureSignTool - - - name: Build and publish app to aws s3 r2 or github artifactory - shell: bash - if: inputs.public_provider != 'github' - run: | - # check public_provider is true or not - echo "public_provider is ${{ inputs.public_provider }}" - if [ "${{ inputs.public_provider }}" == "none" ]; then - make build - else - make build-and-publish - fi - env: - AZURE_KEY_VAULT_URI: ${{ secrets.AZURE_KEY_VAULT_URI }} - AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }} - AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }} - AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }} - AZURE_CERT_NAME: homebrewltd - AWS_ACCESS_KEY_ID: ${{ secrets.DELTA_AWS_ACCESS_KEY_ID }} - AWS_SECRET_ACCESS_KEY: ${{ secrets.DELTA_AWS_SECRET_ACCESS_KEY }} - AWS_DEFAULT_REGION: auto - AWS_EC2_METADATA_DISABLED: 'true' - AWS_MAX_ATTEMPTS: '5' - POSTHOG_KEY: ${{ secrets.POSTHOG_KEY }} - POSTHOG_HOST: ${{ secrets.POSTHOG_HOST }} - CORTEX_API_PORT: ${{ inputs.cortex_api_port }} - - - name: Build app and publish app to github - if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') && inputs.public_provider == 'github' && inputs.beta == false - run: | - make build-and-publish - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - AZURE_KEY_VAULT_URI: ${{ secrets.AZURE_KEY_VAULT_URI }} - AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }} - AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }} - AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }} - AZURE_CERT_NAME: homebrewltd - POSTHOG_KEY: ${{ secrets.POSTHOG_KEY }} - POSTHOG_HOST: ${{ secrets.POSTHOG_HOST }} - - - name: Build app and publish app to github - if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') && inputs.public_provider == 'github' && inputs.beta == true - run: | - make build-and-publish - env: - 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_DEFAULT_REGION: auto - AWS_EC2_METADATA_DISABLED: 'true' - AWS_MAX_ATTEMPTS: '5' - AZURE_KEY_VAULT_URI: ${{ secrets.AZURE_KEY_VAULT_URI }} - AZURE_CLIENT_ID: ${{ secrets.AZURE_CLIENT_ID }} - AZURE_TENANT_ID: ${{ secrets.AZURE_TENANT_ID }} - AZURE_CLIENT_SECRET: ${{ secrets.AZURE_CLIENT_SECRET }} - # AZURE_CERT_NAME: ${{ secrets.AZURE_CERT_NAME }} - AZURE_CERT_NAME: homebrewltd - POSTHOG_KEY: ${{ secrets.POSTHOG_KEY }} - POSTHOG_HOST: ${{ secrets.POSTHOG_HOST }} - - - name: Upload Artifact - if: inputs.public_provider != 'github' - uses: actions/upload-artifact@v4 - with: - name: jan-win-x64-${{ inputs.new_version }} - path: ./electron/dist/*.exe \ No newline at end of file diff --git a/.github/workflows/template-get-update-version.yml b/.github/workflows/template-get-update-version.yml index 97340be81..70f5eace9 100644 --- a/.github/workflows/template-get-update-version.yml +++ b/.github/workflows/template-get-update-version.yml @@ -44,9 +44,12 @@ jobs: exit 1 } - if ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') }}; then + if ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') }}; then echo "Tag detected, set output follow tag" - echo "::set-output name=new_version::${{ steps.tag.outputs.tag }}" + sanitized_tag="${{ steps.tag.outputs.tag }}" + # Remove the 'v' prefix if it exists + sanitized_tag="${sanitized_tag#v}" + echo "::set-output name=new_version::$sanitized_tag" else # Get the latest release tag from GitHub API LATEST_TAG=$(get_latest_tag) diff --git a/.github/workflows/template-tauri-build-linux-x64.yml b/.github/workflows/template-tauri-build-linux-x64.yml index 309401ad9..2d7ebc6a0 100644 --- a/.github/workflows/template-tauri-build-linux-x64.yml +++ b/.github/workflows/template-tauri-build-linux-x64.yml @@ -234,7 +234,7 @@ jobs: ## Upload to github release for stable release - name: Upload release assert if public provider is github - if: inputs.public_provider == 'github' + if: inputs.channel == 'stable' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} uses: actions/upload-release-asset@v1.0.1 @@ -243,6 +243,17 @@ jobs: 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.channel == 'beta' + 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/beta-linux.yml + asset_name: beta-linux.yml + asset_content_type: text/yaml - name: Upload release assert if public provider is github if: inputs.public_provider == 'github' env: diff --git a/.github/workflows/template-tauri-build-macos.yml b/.github/workflows/template-tauri-build-macos.yml index 3a8a88752..dfe1e63e5 100644 --- a/.github/workflows/template-tauri-build-macos.yml +++ b/.github/workflows/template-tauri-build-macos.yml @@ -170,14 +170,14 @@ jobs: 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 + 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 + DMG_NAME=Jan_${{ inputs.new_version }}_universal.dmg TAR_NAME=Jan.app.tar.gz fi @@ -230,16 +230,27 @@ jobs: ## Upload to github release for stable release - name: Upload release assert if public provider is github - if: inputs.public_provider == 'github' + if: inputs.channel == 'stable' 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/latest-mac.yml + asset_path: ./src-tauri/target/universal-apple-darwin/release/bundle/macos/latest-mac.yml asset_name: latest-mac.yml asset_content_type: text/yaml + - name: Upload release assert if public provider is github + if: inputs.channel == 'beta' + 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/bundle/macos/beta-mac.yml + asset_name: beta-mac.yml + asset_content_type: text/yaml + - name: Upload release assert if public provider is github if: inputs.public_provider == 'github' env: @@ -247,7 +258,7 @@ jobs: 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_path: ./src-tauri/target/universal-apple-darwin/release/bundle/macos/${{ steps.metadata.outputs.FILE_NAME }} asset_name: ${{ steps.metadata.outputs.FILE_NAME }} asset_content_type: application/gzip @@ -258,7 +269,7 @@ jobs: 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_path: ./src-tauri/target/universal-apple-darwin/release/bundle/dmg/${{ steps.metadata.outputs.DMG_NAME }} asset_name: ${{ steps.metadata.outputs.DMG_NAME }} asset_content_type: application/octet-stream @@ -269,6 +280,6 @@ jobs: 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_path: ./src-tauri/target/universal-apple-darwin/release/bundle/macos/${{ steps.metadata.outputs.TAR_NAME }} asset_name: ${{ steps.metadata.outputs.TAR_NAME }} asset_content_type: application/gzip \ No newline at end of file diff --git a/.github/workflows/template-tauri-build-windows-x64.yml b/.github/workflows/template-tauri-build-windows-x64.yml index 47dd4ecd2..dcccf3001 100644 --- a/.github/workflows/template-tauri-build-windows-x64.yml +++ b/.github/workflows/template-tauri-build-windows-x64.yml @@ -90,7 +90,6 @@ jobs: cargo install ctoml - name: Update app version base on tag - if: inputs.public_provider != 'github' id: version_update shell: bash run: | @@ -168,7 +167,6 @@ jobs: - name: Build app shell: bash - if: inputs.public_provider != 'github' run: | make build-tauri env: @@ -255,7 +253,7 @@ jobs: ## Upload to github release for stable release - name: Upload release assert if public provider is github - if: inputs.public_provider == 'github' + if: inputs.channel == 'stable' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} uses: actions/upload-release-asset@v1.0.1 @@ -265,6 +263,17 @@ jobs: asset_name: latest.yml asset_content_type: text/yaml + - name: Upload release assert if public provider is github + if: inputs.channel == 'beta' + 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/beta.yml + asset_name: beta.yml + asset_content_type: text/yaml + - name: Upload release assert if public provider is github if: inputs.public_provider == 'github' env: