#Build application for other operating system other than the one youre using
175 messages · Page 1 of 1 (latest)
If you need more you need something like CI or VM. whatever gives you a native-ish host you can build on.
you can't cross-compile to linux or macos from other OSes.
What about compiling on linux for windows?
that's on the page you linked
@foggy thorn Speaking of cross compilation
hi
theres not much problem of that with windows & linux
In Windows, wsl is the best trick to compile to linux
In linux, that guide kinda works
Yeah, that's true
but it takes a lot less resources than a normal vm
with quite great performance
In Linux, compiling for windows is experimental
Basically as much as I know
its because rust is compiled
and not interpreted
that indeed makes it quite a lot harder, yes
Also, this question mainly comes from those migrating from electron
true
but kinda weird considering that electron's cross platform compilation support doesn't really exist either
at least if we're talking about installers/bundles
yup lol
Electron's cross compilation is more like
changing the asar inside the bundle
nothing else
Fun fact is that
electron (their recommended electron-forage) only makes one click installers💀
@foggy thorn I forgot 1 thing
By any means, I don't think one can make macos build without a mac pc/gh actions
okay soooooo
first of all, fuck apple
seriously
secondly it would be possible (on linux at least) if not for apple's shit licensing on the sdk
or well, maybe even then it's pretty hard for tauri apps at least. But in the broader rust ecosystem it should be easier
.app bundles are simple dirs so mostly work too, signing them is a bit ugly but there's a cool rust tool that reverse engineered the process and seems to work pretty nicely
the biggest problem tho is the .dmg file
that's macos only and it doesn't look like that'll change anytime soon
_unless someone hacks into the dmg & kernel stuff I guess
_
and a really important question is coming in my mind
why the user doesn't prefer a CI CD pipeline
the guy that made the codesigning library looked into it and even he couldn't figure it out lol
good question
💀
Apple locks everything up for sure
for private apps i kinda get it, macos ci runners are pretty expensive, but even many many open source apps (free ci on github) don't want it...
actually, i don't get it for private apps either tbh. Nowadays i feel like CI should always build your production apps.
The CI would still be cheaper than buying a mac pc? or probably hackintosh?
or well, not so long ago i had no money for ci either so i don't wanna judge
yeah for sure
My friend did make a hackintosh vm with macos 13
but it'll only till macos offers x86_64 version
after that Hackintosh is dead
macos vms (on linux with qemu) are pretty easy to set up nowadays. But if apple finds out you release (paid) apps with them (or use them in CI) they may as well fck you up
true
But they tend to run pretty bad 🙃
Basically you have to f macos
for cross compilation 💀
@foggy thorn I think the answer is kinda and depends on what target you want to build for
And how much pain you can endure lol
lmao
and for sure, better to not try apple lmao
Whats wsl? And can I compile apps with it on linux for windows?
Its lightweight
wsl can be used to compile linux apps in windows
its a lightweight linux vm
and basically forget about Macos
So whats the best option there is to compile apps for windows but using linux
in cross compilation
Using GitHub Actions
Open Source repos have unlimited minutes
and private repos have 2000 minutes
Whats those limit for?
didn't understand
I suspect you're new to CI CD stuff
if you exceed that you have to pay
or CI will just shut down if you didn't set up payment
they just stop the CI CD
Yes I am new to CI and CD
This can explain better than me
I'm kinda big at explaining lol
https://tauri.app/v1/guides/building/cross-platform#tauri-github-action
name: Release
on:
push:
tags:
- 'v*'
workflow_dispatch:
jobs:
release:
permissions:
contents: write
strategy:
fail-fast: false
matrix:
platform: [macos-latest, ubuntu-20.04, windows-latest]
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install dependencies (ubuntu only)
if: matrix.platform == 'ubuntu-20.04'
# You can remove libayatana-appindicator3-dev if you don't use the system tray feature.
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libayatana-appindicator3-dev librsvg2-dev
- name: Rust setup
uses: dtolnay/rust-toolchain@stable
- name: Rust cache
uses: swatinem/rust-cache@v2
with:
workspaces: './src-tauri -> target'
- name: Sync node version and setup cache
uses: actions/setup-node@v3
with:
node-version: 'lts/*'
cache: 'yarn' # Set this to npm, yarn or pnpm.
- name: Install frontend dependencies
# If you don't have `beforeBuildCommand` configured you may want to build your frontend here too.
run: yarn install # Change this to npm, yarn or pnpm.
- name: Build the app
uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tagName: ${{ github.ref_name }} # This only works if your workflow triggers on new tags.
releaseName: 'App Name v__VERSION__' # tauri-action replaces \_\_VERSION\_\_ with the app version.
releaseBody: 'See the assets to download and install this version.'
releaseDraft: true
prerelease: false
A simple ci cd example ☝️
||@foggy thorn why isn't it using ubuntu-latest tho btw?||
Well how do I know if my CI CD has reached the limit? And what sort of actions does trigger them
Is your code public / private?
if its public
nothing to worry about
its unlimited
Yeah its private
if its private
it'll auto terminate after 2000mins have passed*
*: if no payment has been setupped
Okay thank you, I think Ill will try working with Github Action and Ill just message here if I have further questions
you always built on the latest linux system available (where it still builds).
Because it's also the minmum linux version for the user.
So for example, if you build on 20.04, users on 18.04 can't open your app
i use ubuntu-latest to build my store app 💀
as long as nobody complains i guess :D
So my first step is to push my codes to git hub right?
well, the support of linux is still experimental for my app lmao
Yeah
click actions tab
Okay. Just like said in the docs: Go to the Actions tab on your GitHub project and choose "New workflow", then choose "Set up a workflow yourself". Replace the file with the Tauri Action production build workflow example. Alternatively, you may set up the workflow based on the example at the bottom of this page
ya
And then i just commit the changes?
yes
Done. And next?
do you see some stuff popping up in actions tab
I think I have to replace all yarn to npm cause thats the one Im using
But what about on this part right here? DO I have to change it to npm as well?
if: matrix.platform == 'ubuntu-20.04'
# You can remove libayatana-appindicator3-dev if you don't use the system tray feature.
run: |
sudo npm update
sudo npm install -y libgtk-3-dev libwebkit2gtk-4.0-dev libayatana-appindicator3-dev librsvg2-dev```
Pls ping me
@viral rain No, it must be apt
that's the OS package manger, unrelated to your project
So only the one that says # Set this to npm, yarn or pnpm.
yes
Okay. Hold on
the example has a workflow_dispatch so you can go to the /actions subpage, to your action (url something like https://github.com/FabianLars/mw-toolbox/actions/workflows/publish.yml) and then there should be a button to dispatch it
But theres nothing on my actions tab, and I dont know why
did you commit the file to your default branch?
If it's on a secondary branch it won't be picked up
Its on the default branch (main branch) just like your setup from the repo link you sent me
is your repo public?
Its private @foggy thorn
Pls ping me. When you reply I will be busy in the next couple of hours
@viral rain Can you run this in your local copy of the repo? git tag v0.0.0 && git push --tags
but before that, is the workflow in <project root>/.github/workflows/<workflow-name>.yml ?
Wait
Yes it is. But its just main.yml
I dont think thats a problem. Is it?
nope, the name doesn't matter
So Ill run this now?
yea
It says the new tag is v0.0.0
and it should've pushed it to github right?
if so, can you check the actions tab again?
Yes It gave me a link
Still no work
can you share your workflow file?
Also, what does your actions tab look like? Still like this?
alrighty, that looks good
Can you check this page too? https://github.com/<username>/<reponame>/settings/actions
on the left side, click on Release, does it show the workflow dispatch button in there maybe?
Done and there is also a Run Workflow toggle on the right side
@foggy thorn
yes?
did you click on the toggle on the right side yesterday?
idk what your question is :D
Uhm Yes I did click the toggle
And them it started running; A yellow circle?
yeah, so that may take a while then
But how can I download them? Where do I find them?
Navigate to the /releases tab in your repo
since it's a draft release it won't show up on the main page
installer wise there's only the .deb for debian/ubuntu, correct
the AppImage should work on all distros though
exe and msi for windows?
yes
How about dmg?
Okay thank you very much for your assistance