Compare commits

...

7 Commits

Author SHA1 Message Date
d266f22fdb test that build produces no diff 2019-10-02 16:39:06 +02:00
7f8f39bf55 build 2019-10-02 16:34:58 +02:00
645ab54feb rename 2019-10-02 16:17:18 +02:00
557c7af1de rename to install-nix-action 2019-10-02 16:06:28 +02:00
82911d15ab Merge pull request #3 from cachix/fix-segfault
fixes #1
2019-10-02 15:45:50 +02:00
ff1a6b6f95 Merge pull request #2 from roberth/update-readme
Update README.md, add lib/README.md
2019-10-02 15:42:20 +02:00
fc1e077596 Update README.md, add lib/README.md 2019-10-02 15:36:51 +02:00
6 changed files with 24 additions and 14 deletions

View File

@ -1,4 +1,4 @@
name: "nix-action test" name: "install-nix-action test"
on: on:
pull_request: pull_request:
push: push:
@ -12,6 +12,8 @@ jobs:
- uses: actions/checkout@v1 - uses: actions/checkout@v1
- run: yarn install --frozen-lockfile - run: yarn install --frozen-lockfile
- run: yarn build - run: yarn build
# TODO: just commit it using github
- run: git diff --exit-code
- run: yarn test - run: yarn test
- name: Install Nix - name: Install Nix
uses: ./ uses: ./

View File

@ -1,8 +1,8 @@
# nix-action # install-nix-action
![github actions badge](https://github.com/cachix/nix-action/workflows/nix-action%20test/badge.svg) ![github actions badge](https://github.com/cachix/install-nix-action/workflows/install-nix-action%20test/badge.svg)
Installs [Nix](https://nixos.org/nix/) in platform agnostic way (supports: Linux/macOS). Installs [Nix](https://nixos.org/nix/) on GitHub Actions for the supported platforms: Linux and macOS.
## Usage ## Usage
@ -18,12 +18,13 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v1 - uses: actions/checkout@v1
- uses: cachix/nix-action@v1 - uses: cachix/install-nix-action@v1
- run: nix-build - run: nix-build
``` ```
See also [cachix-action](https://github.com/cachix/cachix-action) for See also [cachix-action](https://github.com/cachix/cachix-action) for
simple binary cache setup. simple binary cache setup to speed up your builds and share binaries
with developers.
--- ---

View File

@ -1,5 +1,5 @@
name: 'Nix' name: 'Install Nix'
description: 'Install Nix' description: 'Installs Nix on GitHub Actions for the supported platforms: Linux and macOS.'
author: 'Domen Kožar' author: 'Domen Kožar'
branding: branding:
color: 'blue' color: 'blue'

5
lib/README.md Normal file
View File

@ -0,0 +1,5 @@
# Generated Code
The files in this directory are generated.
See [src](../src)

View File

@ -24,11 +24,13 @@ const fs_1 = require("fs");
function run() { function run() {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
try { try {
// rest of the constants
const home = os_1.homedir(); const home = os_1.homedir();
const { username } = os_1.userInfo(); const { username } = os_1.userInfo();
const PATH = process.env.PATH; const PATH = process.env.PATH;
const CERTS_PATH = home + '/.nix-profile/etc/ssl/certs/ca-bundle.crt'; const CERTS_PATH = home + '/.nix-profile/etc/ssl/certs/ca-bundle.crt';
// Workaround a segfault: https://github.com/NixOS/nix/issues/2733
yield exec.exec("sudo", ["mkdir", "-p", "/etc/nix"]);
yield exec.exec("sudo", ["echo", "http2 = false", ">>", "/etc/nix/nix.conf"]);
// TODO: retry due to all the things that go wrong // TODO: retry due to all the things that go wrong
const nixInstall = yield tc.downloadTool('https://nixos.org/nix/install'); const nixInstall = yield tc.downloadTool('https://nixos.org/nix/install');
yield exec.exec("sh", [nixInstall]); yield exec.exec("sh", [nixInstall]);

View File

@ -1,8 +1,8 @@
{ {
"name": "nix-action", "name": "install-nix-action",
"version": "1.0.0", "version": "1.0.0",
"private": true, "private": true,
"description": "nix-build with the help of caching to Cachix", "description": "Installs Nix on GitHub Actions for the supported platforms: Linux and macOS.",
"main": "lib/main.js", "main": "lib/main.js",
"scripts": { "scripts": {
"build": "tsc", "build": "tsc",
@ -10,7 +10,7 @@
}, },
"repository": { "repository": {
"type": "git", "type": "git",
"url": "git+https://github.com/cachix/nix-action.git" "url": "git+https://github.com/cachix/install-nix-action.git"
}, },
"keywords": [ "keywords": [
"actions", "actions",