name: Tauri 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-tauri-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 }} channel: beta cortex_api_port: "39271" build-windows-x64: uses: ./.github/workflows/template-tauri-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 }} channel: beta cortex_api_port: "39271" build-linux-x64: uses: ./.github/workflows/template-tauri-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 }} channel: beta cortex_api_port: "39271" 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://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 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" 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_{{ VERSION }}_x64-setup.exe - macOS Universal: https://delta.jan.ai/beta/Jan-beta_{{ VERSION }}_universal.dmg - Linux Deb: https://delta.jan.ai/beta/Jan-beta_{{ VERSION }}_amd64.deb - Linux AppImage: https://delta.jan.ai/beta/Jan-beta_{{ VERSION }}_amd64.AppImage env: DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK_JAN_BETA }}