#Tauri Action compile for MacOS universal without doing a seperate action
53 messages · Page 1 of 1 (latest)
There's a lot of noise in that file but i do this:
https://github.com/FabianLars/mw-toolbox/blob/release/.github/workflows/temp.yml#L22
and
https://github.com/FabianLars/mw-toolbox/blob/release/.github/workflows/temp.yml#L90 (just the args: ${{ matrix.settings.args }} part)
thanks! i'll take a look
Hey @astral mason so I modified my approach just a little. Because i also want to pass in a path to a config file based on which branch is being built:
This is my action file. But what it looks like is that the config argument isn't getting handed into the action...
never used env vars like this in a workflow 🤔
and at least one of the steps that set the var runs? asking cause their ifs are pretty specific
yeah, i can see it set
well interestingly, that doesn't work on windows, but it did on mac. I wonder if theres a better way to do this, i'm basically just wanting to use a specific config depending on the branch thats running the action
i used "normal" step outputs for something similar https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-output-parameter
looks like basically the same thing though
yeah, thats how i used to do it too, this is where i found this new method: https://stackoverflow.com/questions/57968497/how-do-i-set-an-env-var-with-a-bash-expression-in-github-actions
yeah maybe...
well there ya go
nice call!
https://github.com/orgs/community/discussions/26529 this explains a workaround
Ok so i made some adjustments and that seems to be working ok. It was basically just some typos i had in the variables
i so wish testing actions had an easier way lo
lol
i agree so much
Curious, why are the other macOS targets commented out in your workflows? I am only getting a x64 build when trying to use --target universal-apple-darwin in my github workflow. If I uncomment them out, I still only get a x64 build and my updater does not trigger for aarch64 as there is none compiled and listed in the update.json file. 🤔
jobs:
publish-tauri:
strategy:
fail-fast: false
matrix:
settings:
- platform: "macos-latest"
args: "--target universal-apple-darwin"
- platform: 'macos-latest'
args: '--target x86_64-apple-darwin'
- platform: 'macos-latest'
args: '--target aarch64-apple-darwin'
- platform: 'macos-latest'
args: '--target aarch64-apple-darwin'
- platform: "ubuntu-22.04"
args: ""
- platform: "windows-latest"
args: "--target x86_64-pc-windows-msvc"
- platform: "windows-latest"
args: "--target i686-pc-windows-msvc"
runs-on: ${{ matrix.settings.platform }}
A local build on my M1 MacMini using --target universal-apple-darwin produces both architectures
Curious, why are the other macOS targets commented out in your workflows?
Because i abuse the hell out of that workflow. I use it only to testtauri-actionPRs, it's not my actual app release workflow.
did you forget the line from my second link? (not part of the code you posted)
Would that be this one?: #args: ${{ matrix.settings.args }} -c '{"package":{"productName":"injected name"},"build":{"distDir":"../dist"}}'
Background: I have a private repo, I deploy to a public repo from the private one. I need to generate the Universal binary (I realize that it contains both x64 and aarch64 in the bundle). Then, the updater seems to look for the proper download binary for the requesting app. I am trying to generate the proper artifacts and update.JSON that goes with it. Hope this makes sense.
is this line important to comment out? #updaterJsonKeepUniversal: true
I'm not very familiar with GitHub Actions. Honestly, I would prefer a way to do this all locally (build app, publish to my DO spaces account, and have my machine generate both the artifacts and update.json and upload them automatically, much the way electron updater did it for my old app). But I'm sure that is beyond the scope of this thread. Cheers! 😄
just this part args: ${{ matrix.settings.args }}
Thanks!
i'd probably remove it
the action should be smart enough
- name: Build and upload a GitHub release
uses: tauri-apps/tauri-action@v0
env:
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
GITHUB_TOKEN: ${{ secrets.PAT_FOR_PUBLIC_REPO }}
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
with:
owner: bjbk
repo: bani-releases
tagName: v__VERSION__
releaseName: "Bani v__VERSION__"
releaseBody: |
See the assets to download and install this version.
If you get a virus warning read this article: https://tauri.by.simon.hyll.nu/concepts/security/false_positives/.
Windows: Run `attrib -r your-app.msi:Zone.Identifier`.
releaseDraft: false
prerelease: false
args: ${{ matrix.settings.args }}
includeUpdaterJson: true
if you have a macos machine nothing's stopping you from doing it locally
I couldn't find the json file after the build to upload it. Maybe I'm missing a step when building locally. I appreciate your time, you have been very kind. 🙂
right, the json file is a feature of the tauri-action github action, not the cli
so you'd have to create it yourself
gotcha
I'll see if I can learn how to automate that process myself. Thanks again! Cheers!
good luck! :)
Just catching up on this...
@brittle geode i have a local shell script i run to do the same thing that tauri-action does on my github workflow
rustup target add x86_64-apple-darwin
export APPLE_TEAM_ID="<team id>"
export APPLE_SIGNING_IDENTITY="<signing identity>"
export APPLE_ID="<appleid>"
export APPLE_PASSWORD="<apple password>"
export APPLE_CERTIFICATE="<certificate payload>"
export APPLE_CERTIFICATE_PASSWORD="<password>"
cargo tauri build --config ./apps/desktop/src-tauri/tauri.conf.json --target universal-apple-darwin
this is what i run locally, of course change out the config file path or omit if you don't need that (i have multiple tauri config files)
but this builds a universal binary on my macbook pro which has an m2 pro
based on info i've learned too, if you have a mac intel, this "should" still work as well now. I think they've added a cross compiler recently
but i just save that to a bundle.sh file in the root of my repo and then anytime i wanna build locally, i just execute it in the terminal. BUT i would add the file to your .gitignore so you don't share those secrets out to the world