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 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-electron-macos: uses: ./.github/workflows/template-electron-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-electron-windows-x64: uses: ./.github/workflows/template-electron-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-electron-linux-x64: uses: ./.github/workflows/template-electron-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" build-tauri-macos: uses: ./.github/workflows/template-tauri-build-macos-preview.yml secrets: inherit 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-tauri-windows-x64: uses: ./.github/workflows/template-tauri-build-windows-x64-preview.yml secrets: inherit 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-tauri-linux-x64: uses: ./.github/workflows/template-tauri-build-linux-x64-preview.yml secrets: inherit 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: [ build-electron-windows-x64, build-electron-linux-x64, build-electron-macos, build-tauri-windows-x64, build-tauri-linux-x64, build-tauri-macos ] 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: [ get-update-version, sync-temp-to-latest, build-electron-windows-x64, build-electron-linux-x64, build-electron-macos, build-tauri-windows-x64, build-tauri-linux-x64, build-tauri-macos ] 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 Electron: https://delta.jan.ai/beta/jan-beta-win-x64-{{ VERSION }}.exe - macOS Electron Universal: https://delta.jan.ai/beta/jan-beta-mac-universal-{{ VERSION }}.dmg - Linux Electron Deb: https://delta.jan.ai/beta/jan-beta-linux-amd64-{{ VERSION }}.deb - Linux Electron AppImage: https://delta.jan.ai/beta/jan-beta-linux-x86_64-{{ VERSION }}.AppImage - Windows Tauri Preview: https://delta.jan.ai/beta/Jan-beta_{{ VERSION }}_x64-setup-preview.exe - macOS Taupri Preview Universal: https://delta.jan.ai/beta/Jan-beta_{{ VERSION }}_universal-preview.dmg - Linux Tauri Preview Deb: https://delta.jan.ai/beta/Jan-beta_{{ VERSION }}_amd64-preview.deb - Linux Tauri Preview AppImage: https://delta.jan.ai/beta/Jan-beta_{{ VERSION }}_amd64-preview.AppImage env: DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK_JAN_BETA }}