#"You have an error in your yaml syntax on line 37"

178 messages · Page 1 of 1 (latest)

quick smelt
#

when this workflow is executed, it gives me an error on line 37 saying that the syntax is wrong, but I can't notice this error since I've never worked with yaml. Anyone can help me?

name: 'publish'

# This will trigger the action on each push to the `release` branch.
on:
  push:
    branches:
      - main

jobs:
  publish-tauri:
    permissions:
      contents: write
    strategy:
      fail-fast: false
      matrix:
        platform: [macos-latest, ubuntu-20.04, windows-latest]

    runs-on: ${{ matrix.platform }}
    steps:
      - uses: actions/checkout@v4

      - name: setup node
        uses: actions/setup-node@v4
        with:
          node-version: 20

      - name: install Rust stable
        uses: dtolnay/rust-toolchain@stable

      - name: install dependencies (ubuntu only)
        if: matrix.platform == 'ubuntu-20.04'
        run: |
          sudo apt-get update
          sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.0-dev libappindicator3-dev librsvg2-dev patchelf

      - name: install frontend dependencies
        run: pnpm install

            - name: Build
          uses: tauri-apps/tauri-action@v0
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
                    TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
                    TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
        with:
          tagName: app-v__VERSION__
          releaseName: 'App v__VERSION__'
          releaseBody: 'See the assets to download this version and install.'
          releaseDraft: true
          prerelease: false```
#

the line 37 is:

run: pnpm install

pliant pike
#

If this is not a copy paste error in discord, it's talking about the indentation of the next line - name: Build

#

yaml is like python, indentation matters

#

and the uses: line below that should match the env: line

quick smelt
#

It's a discord error

#

I'll send a screenshot of the code

pliant pike
#

can you also share a screenshot of the error?

quick smelt
#

alr

#

wait

#

is having the same problem with indentation

#

strange

pliant pike
#

is there maybe a mix of spaces and tabs?

quick smelt
#

I'll just copy it directly like this

#

and put the envs

#

oh, it worked

#

I didn't know that the presence of both spacings could cause problems

#

also, I'm having this problem now

#

I just put pnpm install

pliant pike
#

since only pnpm needs this i'm not sure yet how to add it to the example

quick smelt
#

I'll try to add it here and get back

#

same error - strange

pliant pike
#

it must be in the same workflow file

quick smelt
quick smelt
#

I've never worked with workflows, so I could end up making mistakes 🦦

#

let me see the example

#

now it worked

#

I'll wait to see if there are any more errors

quick smelt
#

finished

#

but weren't the files supposed to appear here?

pliant pike
#

If your app is on that version, yes

#

do the tauri-action logs contain anything interesting at the bottom?

#

It should tell you what it tries to upload, if any

quick smelt
pliant pike
#

ah, it's a different release

#

it used app-v0.2.2, not v0.2.2

#

drafts don't show up on the frontpage though so you have to go to the /releases tab

quick smelt
#

all here

#

now i have to publish it and that's it?

pliant pike
#

yep

quick smelt
#

alr

#

just one more question

#

I don't understand this endpoints field. What exactly is it for?

#

is it when executing the workflow or when checking for updates?

#

check like this

pliant pike
#

your tauri app will use that config to check for updates

#

though that url won't work

#

the updater isn't smart enough to actually scrape github releases

quick smelt
#

so what exactly does this url have to look like?

#

like this?

#

that points here

pliant pike
#

btw, this only works in public repos

quick smelt
#

oh

#

don't there's a way to use the updater with a private repository? Because this is a comission project

pliant pike
#

there is but it's not easy

#

you'll have to use the actual github api

quick smelt
#

got it

pliant pike
#

i'm sure i wrote about this on this discord server before but i can't find it 🤔

quick smelt
#

F

#

but is that what you mean?

#

a dynamic update server

#

instead of being a json

pliant pike
#

No, the "server" would still be the github release, and still being static

#

but the tauri app side would have to be smarter to get the correct endpoint and download urls dynamically

#

unless of course using a custom server is an option for your comission too, then that can be explored too.

quick smelt
#

the worst thing is that I don't understand any of it 😅

#

I'm only front-end at the moment

#

but I'll see what I can do - I don't want to give you too much trouble

pliant pike
#

don't worry about it, maybe try searching for api.github.com in this discord server. i think everything you find will be related to this topic.

quick smelt
#

right! thanks for your help

#

also i've found that

pliant pike
#

ah right, now i remember. That's the url the server/json file has to give back to the updater

#

so if you use github to host the latest.json file you'll have to update that to point to that url

quick smelt
#

in this case, the endpoint should point to latest.json?

pliant pike
#

yes

#

well

quick smelt
#

this using api.github.com?

pliant pike
#

yeah

#

both the latest.json and the updater artifacts are only available via their api

quick smelt
#

alr

quick smelt
pliant pike
#

yep

quick smelt
#

would that work?

https://api.github.com/repos/7SindDev/tecos-workshop/releases/assets/latest

pliant pike
#

no, you'll need the asset id

#

which you can use to get the id / api url

quick smelt
#

so i have to first use this to get the id

pliant pike
#

yep, you'd replace latest with the asset id

quick smelt
#

so if I have to make more than one request to get it, is that related to this part?

pliant pike
#

nope

quick smelt
#

yeah, I'm still a bit confused

pliant pike
#

like i said, it's not easy 😅

#

gimme a few minutes and i'll give you an overview

quick smelt
#

alr

pliant pike
#

those were some long minutes...

quick smelt
#

it's okay!

#

when it's all right with you, we can continue

#

no need to rush

pliant pike
#

So basically you will have to use the github api in 2 places.

On the server side, if you have a dynamic server this can be dynamic, if not you have to do it by hand or in the build pipeline with a small script.

On the client side (in the tauri app) you have to use it to dynamically set the endpoint url to the json file => If you have an actual update server with a static url this is not necessary.


What makes this a bit more annoying is that you have to upload assets first before you can know their ID (as far as i know), so assuming the static file approach the flow will be:

Build the app -> Upload updater artifacts -> Get the artifacts ids/urls -> Create a latest.json file with those urls and upload it to the same release (or somewhere else?)

Our tauri-action can only do the first 2 steps (plus a latest.json file you have to change, so you may as well skip that)


In the tauri app you will need to use https://docs.github.com/en/rest/releases/releases?apiVersion=2022-11-28#get-the-latest-release to get the url for the latest.json release to use as an "endpoint" (the tauri.conf.json endpoint is useless).
You could make this step easier by uploading the json file to a public repository, then you can use the tauri.conf.json endpoint config again and don't have to change it. This will be safe (unless you have info you want to hide in the changelog) because you need a PAT to access the github api (to download the updater artifacts) anyway.

#

I shouldn't have waited so long to write this down, i forgot everything i wanted to say initially. so idk, feel free to ask questions if i missed something

quick smelt
#

I'll read it soon, I'm working on something!

pliant pike
#

take your time, it's the end of the day for me anyway

quick smelt
#

Does this thread close after a while? It's going to take a while to finish the work here but I won't forget here @pliant pike

pliant pike
#

after a week of inactivity i think

#

but you can reopen it by simply writing a new message, so it's a "soft" close.

quick smelt
#

Right! I will copy this message in case of auto delete this thread

#

I will try to finish the work asap

pliant pike
#

don't worry, threads won't be deleted, they just won't show up in the sidebar if you don't have any unread messages so you'll have to use the forum search to dig them up again. Threads can only be manually deleted by us which we don't do :)

signal ledge
signal ledge
quick smelt
#

is it safe to use actually? He did it 1 year ago

#

If you want, I'll send you the video of the author talking about it

pliant pike
#

i think it's safe yes, but my python days are long over. Also, this one expects your repo to be public (or at least the one hosting your download assets) so there's not much of an advantage over the autogenerated latest.json file (that probably wasn't implemented back then)

#

oh wait, no i think i misread it (like i said, my python is rusty lol)

quick smelt
#

😅

#

well

pliant pike
#

okay nevermind again, my first message was correct, it expects the repo to be public

quick smelt
#

unfortunately it can't be public

#

since it's a commission

#

hmm

#

in this case I'll have to make my own script to do this request thing with api.github.com

pliant pike
#

yep

quick smelt
#

I saw there that you talked about build pipeline. What would that be?

pliant pike
#

generally wherever you're running tauri build to build the app

#

(if you use tauri-action, that counts as tauri build too)

quick smelt
#

in that case I'd have to put the relevant instruction to run the little script here, right?

pliant pike
#

after this step

#

the action has to upload the artifacts first before you're able to get their IDs back from the api

quick smelt
#

oh, ok

#

so like this?

pliant pike
#

yea

quick smelt
#

and where exactly should I put this script? in the root of the project itself or in a specific subdirectory of that root?

pliant pike
#

doesn't matter

quick smelt
#

ok

#

I'm going to make a Python code like this guy did. I'll do the code little by little and send you the progress because I don't know much about the back end at the moment

quick smelt
#

What exactly would this token be?

quick smelt
#

after a thousand years I've made progress

#

I'll continue soon

#

brb

#

the latest.json file

#

after I get the URL of latest.json, what do I have to do?

#

I had forgotten

pliant pike
#

apologies for ghosting you. Do you still have questions?

#

The url of the latest.json file belongs into the endpoints config in tauri.conf.json

quick smelt
#

And yes, I have one

#

So I just have to copy this URL and put it in the endpoint?

pliant pike
#

yep

quick smelt
#

@pliant pike

#

I called a friend to help me with the implementation of this auto updater. He's made more progress than me but is having some strange problems. If you could discuss this problem with him, it would be better, as he has a better understanding of back end

#

And sorry for taking so long to reply, I was doing something else

zealous obsidian
#

hello

#

I was helping @quick smelt

#

Even if I sending the correct github credetials paramenters, I'm getting 404

pliant pike
#

Also, the type of github token may cause issues too, at least it did for me back then. But it should be a 5xx error so let's worry about that later.

quick smelt
#

@pliant pike well, my friend was going to try to implement an updater of his own, but I talked to the client about the status of the implementation and he said he doesn't need to implement it anymore, so it kind of ends here. I really appreciate your help and patience! I'm also sorry if this whole discussion didn't reach the expected result

#

Maybe this thread will help other people who want to implement it too