Skip to content

Add an option to install nightly build #16

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

Merged
merged 1 commit into from
Aug 4, 2021
Merged
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
21 changes: 17 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,22 @@ jobs:
- '2.6'
- '2.7'
- '2.8'
- '2.9'
nightly: [false]
include:
- {runs-on: ubuntu-18.04, tarantool: '1.10'}
- {runs-on: ubuntu-16.04, tarantool: '1.10'}
- {runs-on: ubuntu-18.04, tarantool: '1.10', nightly: true}
- {runs-on: ubuntu-16.04, tarantool: '1.10', nightly: true}
runs-on: ${{ matrix.runs-on }}
env:
TARANTOOL_CACHE_KEY_SUFFIX: -${{ github.run_id }}
TARANTOOL_CACHE_KEY_SUFFIX: -A-${{ github.run_id }}
steps:
- uses: actions/checkout@v2

- id: get-latest
run: |
node <<'SCRIPT'
process.env["INPUT_TARANTOOL-VERSION"] = "${{ matrix.tarantool }}"
process.env["INPUT_NIGHTLY-BUILD"] = "${{ matrix.nightly }}"
require("./dist/main").latest_version().then(v => {
console.log(v)
console.log(`::set-output name=version::${v}`)
Expand All @@ -39,6 +42,7 @@ jobs:
uses: ./
with:
tarantool-version: ${{ matrix.tarantool }}
nightly-build: ${{ matrix.nightly }}

- name: Check precise version
run: |
Expand All @@ -52,6 +56,15 @@ jobs:
uses: ./
with:
tarantool-version: ${{ matrix.tarantool }}
nightly-build: ${{ matrix.nightly }}

- name: Verify install from cache
run: |
# Fail if tarantool is installed from apt-get
if dpkg -s tarantool; then
echo "Tarantool wasn't restored from cache"
exit 1
fi

- name: Check branch version
run: |
Expand All @@ -70,7 +83,7 @@ jobs:
runs-on: [ubuntu-20.04, ubuntu-20.04, ubuntu-20.04]
runs-on: ${{ matrix.runs-on }}
env:
TARANTOOL_CACHE_KEY_SUFFIX: -${{ github.run_id }}
TARANTOOL_CACHE_KEY_SUFFIX: -B-${{ github.run_id }}
steps:
- uses: actions/checkout@v2
- name: Setup Tarantool
Expand Down
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,17 @@ steps:
- run: .rocks/bin/luatest -v
```

### Install a nightly build

```yaml
steps:
- uses: actions/checkout@v2
- uses: tarantool/setup-tarantool@v1
with:
tarantool-version: '2.6'
nightly-build: true
```

# License

The scripts and documentation in this project are released under the [MIT License](LICENSE).
Expand Down
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ branding:
inputs:
tarantool-version:
description: Tarantool version
nightly-build:
description: Whether to install a nightly build
required: false
default: false
cache-key:
description: Deprecated. Custom key used for APT packages caching
required: false
Expand Down
4 changes: 3 additions & 1 deletion dist/main/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3400,7 +3400,9 @@ const exec = __importStar(__webpack_require__(986));
const io = __importStar(__webpack_require__(1));
const path = __importStar(__webpack_require__(622));
const fs = __importStar(__webpack_require__(747));
const baseUrl = 'https://download.tarantool.org/tarantool/release/' +
const nightlyBuild = (core.getInput('nightly-build') || 'false').toUpperCase() === 'TRUE';
const baseUrl = 'https://download.tarantool.org/tarantool/' +
(nightlyBuild ? '' : 'release/') +
core.getInput('tarantool-version', { required: true });
async function capture(cmd, options) {
let output = '';
Expand Down
5 changes: 4 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@ import * as io from '@actions/io'
import * as path from 'path'
import * as fs from 'fs'

const nightlyBuild =
(core.getInput('nightly-build') || 'false').toUpperCase() === 'TRUE'
const baseUrl =
'https://download.tarantool.org/tarantool/release/' +
'https://download.tarantool.org/tarantool/' +
(nightlyBuild ? '' : 'release/') +
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is explicit 'live' URL part, if you want.

In the next bullets 2 and 3 are equal, but the latter is more explicit.

  1. https://download.tarantool.org/tarantool/release/<...>
  2. https://download.tarantool.org/tarantool/live/<...>
  3. https://download.tarantool.org/tarantool/<...>

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Accepted.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The trick didn't work:

$ curl -v https://download.tarantool.org/tarantool/live/1.10/gpgkey

HTTP/1.1 302 Moved Temporarily
Location: https://www.tarantool.io/download/

I'll merge without it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's the bug. Sorry. Okay.

core.getInput('tarantool-version', {required: true})

interface CaptureOptions {
Expand Down