Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Support for Feature/Beta Builds #8

Open
sambacha opened this issue May 28, 2022 · 0 comments
Open

Feature: Support for Feature/Beta Builds #8

sambacha opened this issue May 28, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@sambacha
Copy link
Contributor

Support development builds

Foundry would have to add an additional identifier in its versioning to distinguish between nightly proper and dev/pr builds like

0.2.0-pr-47126-18

Also it would only work on branches in the main repo, not PR's (I think)

Something along the lines of this:

import * as core from '@actions/core'
import * as tc from '@actions/tool-cache'

async function run(): Promise<void> {
  try {
    const toolDir = tc.find('platform-', 'nightly-', 'x64')
    if (toolDir !== '') {
      core.addPath(toolDir)
      return
    }

    const channel = core.getInput('channel')

    // TODO: use feature/branch, github PR# for channels 
    if (!['nightly', 'edge', 'pr#', 'beta', ''].includes(channel)) {
      core.setFailed(`Unknown release channel ${channel}`)
      return
    }


      switch (process.platform) {
      case 'darwin': {
        let toolUrl =
          'https://nightly--darwin-amd64.zip'
        if (channel === 'beta') {
          toolUrl =
            'https://edge-darwin-amd64.zip'
        }
        const downloadPath = await tc.downloadTool(toolUrl)
        const extPath = await tc.extractZip(downloadPath)
        const cachedPath = await tc.cacheDir(extPath, 'release-', 'nightly-')
        core.addPath(cachedPath)
        break
      }

      case 'linux': {
        let toolUrl =
          'https://nightly-linux-amd64.tar.gz'
        if (channel === 'beta') {
          toolUrl =
            'https://edge-linux-amd64.tar.gz'
        }
        const downloadPath = await tc.downloadTool(toolUrl)
        const extPath = await tc.extractTar(downloadPath)
        const cachedPath = await tc.cacheDir(extPath, 'release-', 'nightly-')
        core.addPath(cachedPath)
        break
      }

      default: {
        core.setFailed(`Unsupported platform: ${process.platform}`)
      }
    }
  } catch (error) {
    core.setFailed(error.message)
  }
}

run()
@onbjerg onbjerg added the enhancement New feature or request label Feb 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants