denolib / setup-deno

Set up your GitHub Actions workflow with a specific version of deno
https://github.com/marketplace/actions/setup-deno-environment
MIT License
181 stars 16 forks source link

support for Deno Nightly builds #48

Closed maximousblk closed 4 years ago

maximousblk commented 4 years ago

It would be really nice if this action included an option for using deno nightly builds

As you may know there are many modules breaking due to the URL definition update and Deno.dir() removal.

We at nest.land prevent these bugs by testing our modules on the Deno Nightly builds. But not all other do this yet. and it is a bit finicky to set this up right now. and because of that the dependencies that we use tend to break our modules. which feels like we know what's wrong and know how to fix it but have to wait for the module owners to fix it.

So if this action included nightly builds option more module authors could set this up easily and prevent such breaking.

I tried making a new action but didn't get much success at it.

It is really easy to get the latest nightly build. there is a release tagged latest which is updated with the latest build daily. so you don't have to do all the regex stuff and just directly link to the latest build if the Deno version is set to nightly. there are separate build releases too tagged by the date they were built.

Deno Nightly repo: maximousblk/deno_nightly

so for using the latest nightly build you would do:

  - uses: denolib/setup-deno@v2
    with:
      deno-version: nightly
  - run: deno-nightly run https://deno.land/std/examples/welcome.ts
axetroy commented 4 years ago

SGTM!

But I am not sure if the nightly build you provided is stable.

In theory, we only need to deal with nightly tag like this

jobs:
  build:
    runs-on: ubuntu-16.04
    strategy:
      matrix:
        deno: ["v1.x", "nightly"]
    name: Deno ${{ matrix.deno }} sample
    steps:
      - uses: actions/checkout@v2
      - name: Setup Deno
        uses: denolib/setup-deno@v2
        with:
          deno-version: ${{ matrix.deno }}
      - run: deno run https://deno.land/std/examples/welcome.ts

I prefer to get the nightly build version via the official

Maybe you can feedback to @ry and make it become official

maximousblk commented 4 years ago

Thanks for your interest!

But I am not sure if the nightly build you provided is stable.

yes they are not guaranteed to be stable because they are built from the master branch of the deno repo. they are only for testing purposes.

        deno: ["v1.x", "nightly"]

this would not work because the nightly builds are named deno-nightly so that we can use it without disturbing the stable installation on our local machines

axetroy commented 4 years ago

yes they are not guaranteed to be stable because they are built from the master branch of the deno repo. they are only for testing purposes.

I mean, Are the servers built daily stable? Will there be server down, Apis rate limit? domain name replacement? and other uncertainties.

maximousblk commented 4 years ago

I mean, Are the servers built daily stable?

you lost me there. If you are referring to the servers where Deno is built, it's github actions.

but

domain replacement and server downtime would depend on github because to get the latest build, all you need is to download from github releases.

export function getDownloadUrl(): string {
  const platform = getDenoPlatform(version);
  const arch = getDenoArch(version);
  let filename: string = `deno-nightly-${arch}-${platform}.zip`;

  return `https://github.com/maximousblk/deno_nightly/releases/download/latest/${filename}`;
}

You don't need to use GitHub API to get the releases and I don't think github rate limits release downloads.

axetroy commented 4 years ago

I’m curious why deno-nightly instead of deno

Is there any special reason?

  - uses: denolib/setup-deno@v2
    with:
      deno-version: nightly
-  - run: deno run https://deno.land/std/examples/welcome.ts
+  - run: deno-nightly run https://deno.land/std/examples/welcome.ts
maximousblk commented 4 years ago

I chose deno-nightly because there is no other way to differentiate between the stable and nightly binaries because the nightly builds have the privious version on them. And I didn't want to modify the source because... trust.

The other reason is you can have a nightly build and stable version on your local machine both at the same time. So it does not disturb your current dev environment and still gives you an option to test your unpushed code.