Skip to content

Commit 760a110

Browse files
committed
Initial commit
Supporting only Windows 🙃
0 parents  commit 760a110

File tree

14 files changed

+7084
-0
lines changed

14 files changed

+7084
-0
lines changed

.eslintrc.json

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
{
2+
"env": {
3+
"commonjs": true,
4+
"es6": true,
5+
"node": true,
6+
"jest": true
7+
},
8+
"extends": "eslint:recommended",
9+
"globals": {
10+
"Atomics": "readonly",
11+
"SharedArrayBuffer": "readonly"
12+
},
13+
"parserOptions": {
14+
"ecmaVersion": 2018
15+
},
16+
"rules": {
17+
"block-scoped-var": "error",
18+
"consistent-return": "error",
19+
"curly": "error",
20+
"eqeqeq": "error",
21+
"no-floating-decimal": "error",
22+
"no-implicit-globals": "error",
23+
"no-implied-eval": "error",
24+
"no-multi-spaces": "error",
25+
"no-multi-str": "error",
26+
"no-return-assign": "error",
27+
"no-return-await": "error",
28+
"no-self-compare": "error",
29+
"no-sequences": "error",
30+
"no-useless-return": "error",
31+
"require-await": "error",
32+
"yoda": "error",
33+
34+
"brace-style": "error",
35+
"camelcase": "error",
36+
"comma-dangle": ["error", "always-multiline"],
37+
"comma-spacing": "error",
38+
"comma-style": "error",
39+
"computed-property-spacing": "error",
40+
"eol-last": "error",
41+
"func-call-spacing": "error",
42+
"implicit-arrow-linebreak": "error",
43+
"indent": "error",
44+
"key-spacing": "error",
45+
"keyword-spacing": "error",
46+
"max-len": ["error", {"code": 100, "ignoreStrings": true, "ignoreTemplateLiterals": true}],
47+
"no-mixed-operators": "error",
48+
"no-multiple-empty-lines": "error",
49+
"no-trailing-spaces": "error",
50+
"no-unneeded-ternary": "error",
51+
"no-whitespace-before-property": "error",
52+
"object-curly-spacing": ["error", "never"],
53+
"operator-assignment": "error",
54+
"padded-blocks": ["error", "never"],
55+
"quotes": "error",
56+
"semi": "error",
57+
"semi-spacing": "error",
58+
"semi-style": "error",
59+
"space-before-function-paren": ["error", {
60+
"anonymous": "always", "named": "never", "asyncArrow": "always"
61+
}],
62+
"space-infix-ops": "error",
63+
"space-unary-ops": "error",
64+
"spaced-comment": "error",
65+
"switch-colon-spacing": "error",
66+
"template-tag-spacing": "error",
67+
"unicode-bom": "error",
68+
69+
"arrow-body-style": "error",
70+
"arrow-parens": "error",
71+
"arrow-spacing": "error",
72+
"generator-star-spacing": ["error", "after"],
73+
"no-duplicate-imports": "error",
74+
"no-var": "error",
75+
"prefer-destructuring": "error",
76+
"prefer-numeric-literals": "error",
77+
"prefer-rest-params": "error",
78+
"prefer-spread": "error",
79+
"rest-spread-spacing": "error",
80+
"sort-imports": "error",
81+
"template-curly-spacing": "error",
82+
"yield-star-spacing": "error"
83+
}
84+
}

.github/workflows/main.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- master
8+
- v1
9+
schedule:
10+
- cron: '0 6 * * 6'
11+
12+
jobs:
13+
test:
14+
runs-on: windows-latest
15+
steps:
16+
- uses: actions/checkout@v2
17+
- run: npm install
18+
- uses: ./
19+
- run: crystal eval "puts 1337"
20+
- run: npm test
21+
- run: npm audit --audit-level=moderate

.github/workflows/release.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: CI (release)
2+
3+
on:
4+
push:
5+
branches:
6+
- v1
7+
schedule:
8+
- cron: '0 6 * * 6'
9+
10+
jobs:
11+
test:
12+
runs-on: windows-latest
13+
steps:
14+
- uses: oprypin/install-crystal@v1
15+
- run: crystal eval "puts 1337"

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules/

.util/cmd

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/sh
2+
3+
cat "$(dirname "$0")/mock-vcvars.txt"

.util/mock-vcvars.txt

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
ALLUSERSPROFILE=C:\ProgramData
2+
APPDATA=C:\Users\User\AppData\Roaming
3+
CommonProgramFiles=C:\Program Files\Common Files
4+
CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files
5+
CommonProgramW6432=C:\Program Files\Common Files
6+
COMPUTERNAME=FOO
7+
ComSpec=C:\Windows\system32\cmd.exe
8+
DriverData=C:\Windows\System32\Drivers\DriverData
9+
HOMEDRIVE=C:
10+
HOMEPATH=\Users\User
11+
LOCALAPPDATA=C:\Users\User\AppData\Local
12+
LOGONSERVER=\\FOO
13+
NUMBER_OF_PROCESSORS=2
14+
OS=Windows_NT
15+
Path=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\Git\cmd;C:\Users\User\AppData\Local\Microsoft\WindowsApps
16+
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
17+
PROCESSOR_ARCHITECTURE=AMD64
18+
PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 94 Stepping 3, GenuineIntel
19+
PROCESSOR_LEVEL=6
20+
PROCESSOR_REVISION=5e03
21+
ProgramData=C:\ProgramData
22+
ProgramFiles=C:\Program Files
23+
ProgramFiles(x86)=C:\Program Files (x86)
24+
ProgramW6432=C:\Program Files
25+
PROMPT=$P$G
26+
PSModulePath=C:\Program Files\WindowsPowerShell\Modules;C:\Windows\system32\WindowsPowerShell\v1.0\Modules
27+
PUBLIC=C:\Users\Public
28+
SESSIONNAME=Console
29+
SystemDrive=C:
30+
SystemRoot=C:\Windows
31+
TEMP=C:\Users\User\AppData\Local\Temp
32+
TMP=C:\Users\User\AppData\Local\Temp
33+
USERDOMAIN=FOO
34+
USERDOMAIN_ROAMINGPROFILE=FOO
35+
USERNAME=User
36+
USERPROFILE=C:\Users\User
37+
windir=C:\Windows
38+
---
39+
ALLUSERSPROFILE=C:\ProgramData
40+
APPDATA=C:\Users\User\AppData\Roaming
41+
CommandPromptType=Native
42+
CommonProgramFiles=C:\Program Files\Common Files
43+
CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files
44+
CommonProgramW6432=C:\Program Files\Common Files
45+
COMPUTERNAME=FOO
46+
ComSpec=C:\Windows\system32\cmd.exe
47+
DevEnvDir=C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\Common7\IDE\
48+
DriverData=C:\Windows\System32\Drivers\DriverData
49+
ExtensionSdkDir=C:\Program Files (x86)\Microsoft SDKs\Windows Kits\10\ExtensionSDKs
50+
Framework40Version=v4.0
51+
FrameworkDir=C:\Windows\Microsoft.NET\Framework64\
52+
FrameworkDir64=C:\Windows\Microsoft.NET\Framework64\
53+
FrameworkVersion=v4.0.30319
54+
FrameworkVersion64=v4.0.30319
55+
HOMEDRIVE=C:
56+
HOMEPATH=\Users\User
57+
INCLUDE=C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.25.28610\ATLMFC\include;C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.25.28610\include;C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\include\um;C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\ucrt;C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared;C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um;C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\winrt;C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\cppwinrt
58+
LIB=C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.25.28610\ATLMFC\lib\x64;C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.25.28610\lib\x64;C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\lib\um\x64;C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\ucrt\x64;C:\Program Files (x86)\Windows Kits\10\lib\10.0.18362.0\um\x64;
59+
LIBPATH=C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.25.28610\ATLMFC\lib\x64;C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.25.28610\lib\x64;C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.25.28610\lib\x86\store\references;C:\Program Files (x86)\Windows Kits\10\UnionMetadata\10.0.18362.0;C:\Program Files (x86)\Windows Kits\10\References\10.0.18362.0;C:\Windows\Microsoft.NET\Framework64\v4.0.30319;
60+
LOCALAPPDATA=C:\Users\User\AppData\Local
61+
LOGONSERVER=\\FOO
62+
NETFXSDKDir=C:\Program Files (x86)\Windows Kits\NETFXSDK\4.8\
63+
NUMBER_OF_PROCESSORS=2
64+
OS=Windows_NT
65+
Path=C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.25.28610\bin\HostX64\x64;C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\Common7\IDE\CommonExtensions\Microsoft\TestWindow;C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\bin\Roslyn;C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\x64\;C:\Program Files (x86)\Windows Kits\10\bin\10.0.18362.0\x64;C:\Program Files (x86)\Windows Kits\10\bin\x64;C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\\MSBuild\Current\Bin;C:\Windows\Microsoft.NET\Framework64\v4.0.30319;C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\Common7\IDE\;C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\Common7\Tools\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\Git\cmd;C:\Users\User\AppData\Local\Microsoft\WindowsApps;C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin;C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja
66+
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
67+
Platform=x64
68+
PROCESSOR_ARCHITECTURE=AMD64
69+
PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 94 Stepping 3, GenuineIntel
70+
PROCESSOR_LEVEL=6
71+
PROCESSOR_REVISION=5e03
72+
ProgramData=C:\ProgramData
73+
ProgramFiles=C:\Program Files
74+
ProgramFiles(x86)=C:\Program Files (x86)
75+
ProgramW6432=C:\Program Files
76+
PROMPT=$P$G
77+
PSModulePath=C:\Program Files\WindowsPowerShell\Modules;C:\Windows\system32\WindowsPowerShell\v1.0\Modules
78+
PUBLIC=C:\Users\Public
79+
SESSIONNAME=Console
80+
SystemDrive=C:
81+
SystemRoot=C:\Windows
82+
TEMP=C:\Users\User\AppData\Local\Temp
83+
TMP=C:\Users\User\AppData\Local\Temp
84+
UCRTVersion=10.0.18362.0
85+
UniversalCRTSdkDir=C:\Program Files (x86)\Windows Kits\10\
86+
USERDOMAIN=FOO
87+
USERDOMAIN_ROAMINGPROFILE=FOO
88+
USERNAME=User
89+
USERPROFILE=C:\Users\User
90+
VCIDEInstallDir=C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\Common7\IDE\VC\
91+
VCINSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\
92+
VCToolsInstallDir=C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.25.28610\
93+
VCToolsRedistDir=C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Redist\MSVC\14.25.28508\
94+
VCToolsVersion=14.25.28610
95+
VisualStudioVersion=16.0
96+
VS160COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\Common7\Tools\
97+
VSCMD_ARG_app_plat=Desktop
98+
VSCMD_ARG_HOST_ARCH=x64
99+
VSCMD_ARG_TGT_ARCH=x64
100+
VSCMD_VER=16.5.1
101+
VSINSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\
102+
windir=C:\Windows
103+
WindowsLibPath=C:\Program Files (x86)\Windows Kits\10\UnionMetadata\10.0.18362.0;C:\Program Files (x86)\Windows Kits\10\References\10.0.18362.0
104+
WindowsSdkBinPath=C:\Program Files (x86)\Windows Kits\10\bin\
105+
WindowsSdkDir=C:\Program Files (x86)\Windows Kits\10\
106+
WindowsSDKLibVersion=10.0.18362.0\
107+
WindowsSdkVerBinPath=C:\Program Files (x86)\Windows Kits\10\bin\10.0.18362.0\
108+
WindowsSDKVersion=10.0.18362.0\
109+
WindowsSDK_ExecutablePath_x64=C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\x64\
110+
WindowsSDK_ExecutablePath_x86=C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\
111+
__DOTNET_ADD_64BIT=1
112+
__DOTNET_PREFERRED_BITNESS=64
113+
__VSCMD_PREINIT_PATH=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\Git\cmd;C:\Users\User\AppData\Local\Microsoft\WindowsApps

.util/release.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/bash
2+
3+
set -e -u -x
4+
5+
cd "$(dirname "$0")/.."
6+
7+
rm -rf node_modules
8+
git checkout v1
9+
GIT_EDITOR=true git merge master
10+
sed -i -E -e 's/"version": ".+",/"version": "'"$1"'",/' package.json
11+
git diff --quiet && false
12+
rm -rf node_modules
13+
npm install --production
14+
git add -f node_modules package.json package-lock.json
15+
git diff --quiet
16+
git commit -m "v$1"
17+
git tag "v$1"
18+
echo git push --follow-tags

LICENSE.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2020 Oleh Prypin <[email protected]>
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
install-crystal
2+
===============
3+
4+
[GitHub Action][] to **install [Crystal][] programming language**
5+
6+
Currently works only on Windows, always downloads the latest "nightly" build.
7+
8+
## Examples
9+
10+
```yaml
11+
steps:
12+
- uses: oprypin/install-crystal@v1
13+
- run: crystal eval "puts 1337"
14+
```
15+
16+
## Usage
17+
18+
### Inputs
19+
20+
* **`token: ${{ github.token }}`**
21+
22+
Personal access token (auto-populated).
23+
24+
* **`destination: some/path`**
25+
26+
The directory to store Crystal in, after extracting.
27+
28+
### Outputs
29+
30+
* **`crystal`** (`${{ steps.some_step_id.outputs.crystal }}`)
31+
32+
The actual version of Crystal (as a ref in crystal-lang/[crystal.git][]) that was installed.
33+
34+
35+
[github action]: https://github.com/features/actions
36+
[crystal]: https://crystal-lang.org/
37+
[crystal.git]: https://github.com/crystal-lang/crystal

action.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: Install Crystal
2+
description: Install Crystal programming language
3+
inputs:
4+
token:
5+
description: Personal access token (auto-populated)
6+
default: ${{ github.token }}
7+
destination:
8+
description: The directory to store Crystal in
9+
runs:
10+
using: node12
11+
main: index.js
12+
branding:
13+
icon: octagon
14+
color: gray-dark

0 commit comments

Comments
 (0)