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

feat: allow skip tinygo install #12

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,18 @@ steps:
binaryen-version: '116'
```

### Without TinyGo

If you don't need TinyGo, you can omit the installation

```yaml
steps:
- uses: actions/checkout@v2
- uses: acifani/setup-tinygo@v2
with:
install-tinygo: 'false'
```

### Without Binaryen

If you don't need Binaryen, you can omit the installation
Expand Down
3 changes: 3 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ branding:
icon: 'play'
color: 'blue'
inputs:
install-tinygo:
description: 'Whether you want to install TinyGo or not.'
default: 'true'
tinygo-version:
description: 'The exact TinyGo version to download and use.'
default: '0.30.0'
Expand Down
12 changes: 9 additions & 3 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,15 @@ const install_2 = __nccwpck_require__(9718);
setup();
async function setup() {
try {
const tinyGoVersion = core.getInput('tinygo-version');
core.info(`Setting up tinygo version ${tinyGoVersion}`);
await (0, install_2.installTinyGo)(tinyGoVersion);
const shouldInstallTinyGo = core.getInput('install-tinygo');
if (shouldInstallTinyGo === 'false') {
core.info('Skipping TinyGo installation');
}
else {
const tinyGoVersion = core.getInput('tinygo-version');
core.info(`Setting up tinygo version ${tinyGoVersion}`);
await (0, install_2.installTinyGo)(tinyGoVersion);
}
const shouldInstallBinaryen = core.getInput('install-binaryen');
if (shouldInstallBinaryen === 'false') {
core.info('Skipping binaryen installation');
Expand Down
11 changes: 8 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,14 @@ setup();

async function setup() {
try {
const tinyGoVersion = core.getInput('tinygo-version');
core.info(`Setting up tinygo version ${tinyGoVersion}`);
await installTinyGo(tinyGoVersion);
const shouldInstallTinyGo = core.getInput('install-tinygo');
if (shouldInstallTinyGo === 'false') {
core.info('Skipping TinyGo installation');
} else {
const tinyGoVersion = core.getInput('tinygo-version');
core.info(`Setting up tinygo version ${tinyGoVersion}`);
await installTinyGo(tinyGoVersion);
}

const shouldInstallBinaryen = core.getInput('install-binaryen');
if (shouldInstallBinaryen === 'false') {
Expand Down