Skip to content

Commit

Permalink
remove install-flox script
Browse files Browse the repository at this point in the history
  • Loading branch information
garbas committed May 31, 2024
1 parent 948a6f0 commit b56959f
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 169 deletions.
11 changes: 10 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
uses: "actions/checkout@v4"

- name: "Install Nix"
uses: "cachix/install-nix-action@V27"
uses: "cachix/install-nix-action@v27"

- name: "Cache Dependencies"
id: cache
Expand Down Expand Up @@ -73,6 +73,9 @@ jobs:
- name: "Checkout"
uses: "actions/checkout@v4"

- name: "Install Nix"
uses: "cachix/install-nix-action@v27"

- name: "Test Local Action"
uses: "./"
with:
Expand Down Expand Up @@ -104,6 +107,9 @@ jobs:
tags: tag:ci
authkey: "${{ secrets.MANAGED_TAILSCALE_AUTH_KEY }}"

- name: "Install Nix"
uses: "cachix/install-nix-action@v27"

- name: "Test Local Action"
uses: "./"
with:
Expand Down Expand Up @@ -161,6 +167,9 @@ jobs:
tags: tag:ci
authkey: "${{ secrets.MANAGED_TAILSCALE_AUTH_KEY }}"

- name: "Install Nix"
uses: "cachix/install-nix-action@v27"

- name: "Test Local Action"
uses: "./"
with:
Expand Down
4 changes: 0 additions & 4 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ branding:

inputs:

base-url:
description: "Download base URL of flox installer"
default: "https://downloads.flox.dev/by-env/stable"

git-user:
description: "Name of the `author` and `commiter` in git if not set already"
default: "Example User"
Expand Down
2 changes: 1 addition & 1 deletion badges/coverage.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
59 changes: 0 additions & 59 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

46 changes: 0 additions & 46 deletions scripts/install-flox.sh

This file was deleted.

8 changes: 0 additions & 8 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,6 @@ const utils = require('./utils')
const which = require('which')

export async function run() {
const nix = await which('nix', { nothrow: true })
if (nix === null) {
core.startGroup('Download & Install flox')
await utils.getDownloadUrl()
await exec.exec('bash', ['-c', utils.SCRIPTS.installFlox])
core.endGroup()
}

core.startGroup('Configure Git')
utils.exportVariableFromInput('git-user')
utils.exportVariableFromInput('git-email')
Expand Down
50 changes: 0 additions & 50 deletions src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ export function scriptPath(name) {
}

export const SCRIPTS = {
installFlox: scriptPath('install-flox.sh'),
configureSubstituter: scriptPath('configure-substituter.sh'),
configureAWS: scriptPath('configure-aws.sh'),
configureGit: scriptPath('configure-git.sh'),
Expand All @@ -43,52 +42,3 @@ export function exportVariableFromInput(input, defaultValue = '') {
core.exportVariable(name, value)
return value
}

export async function getDownloadUrl() {
const rpm = await which('rpm', { nothrow: true })
const dpkg = await which('dpkg', { nothrow: true })

const BASE_URL = core.getInput('base-url')
core.debug(`Base URL is: ${BASE_URL}`)

let downloadUrl

if (process.platform === 'darwin' && process.arch === 'x64') {
downloadUrl = `${BASE_URL}/osx/flox.x86_64-darwin.pkg`
} else if (process.platform === 'darwin' && process.arch === 'arm64') {
downloadUrl = `${BASE_URL}/osx/flox.aarch64-darwin.pkg`
} else if (
dpkg !== null &&
process.platform === 'linux' &&
process.arch === 'x64'
) {
downloadUrl = `${BASE_URL}/deb/flox.x86_64-linux.deb`
} else if (
dpkg !== null &&
process.platform === 'linux' &&
process.arch === 'arm64'
) {
downloadUrl = `${BASE_URL}/deb/flox.aarch64-linux.deb`
} else if (
rpm !== null &&
process.platform === 'linux' &&
process.arch === 'x64'
) {
downloadUrl = `${BASE_URL}/rpm/flox.x86_64-linux.rpm`
} else if (
rpm !== null &&
process.platform === 'linux' &&
process.arch === 'arm64'
) {
downloadUrl = `${BASE_URL}/rpm/flox.aarch64-linux.rpm`
} else {
core.setFailed(
`No platform (${process.platform}) or arch (${process.arch}) or OS matched.`
)
}

core.info(`DOWNLOAD_URL resolved to ${downloadUrl}`)
core.exportVariable('INPUT_DOWNLOAD_URL', downloadUrl)

return downloadUrl
}

0 comments on commit b56959f

Please sign in to comment.