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

Rename the julia-version input to channel #61

Merged
merged 4 commits into from
May 30, 2024
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
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ jobs:
strategy:
fail-fast: false
matrix:
julia-version:
channel:
- '1.9.4'
- '1.10.2'
os:
Expand Down Expand Up @@ -164,10 +164,10 @@ jobs:
- name: Run the local copy of this action (that is checked in to source control)
uses: ./
with:
julia-version: ${{ matrix.julia-version }}
channel: ${{ matrix.channel }}
- run: julia ci/test.jl
env:
EXPECTED_JULIA_VERSION_FOR_TESTS: ${{ matrix.julia-version }}
EXPECTED_JULIA_VERSION_FOR_TESTS: ${{ matrix.channel }}
- name: '[after] Print some output for debugging purposes'
shell: bash
run: |
Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ To install the latest stable Julia v1:
```yaml
- uses: julia-actions/install-juliaup@v1
with:
julia-version: '1'
channel: '1'

# Your selected Julia version is now available in the PATH:
- run: julia --version
Expand All @@ -28,17 +28,17 @@ To install a specific Julia version:
```yaml
- uses: julia-actions/install-juliaup@v1
with:
julia-version: '1.10.2'
channel: '1.10.2'
```

In general, if `juliaup add FOO` would have been a valid command on your local machine, then `FOO` is a valid value for the `julia-version` input to this action.
In general, if `juliaup add FOO` would have been a valid command on your local machine, then `FOO` is a valid value for the `channel` input to this action.

So, for example, suppose that you want alpha pre-releases for the next upcoming release. On your local machine, `juliaup add alpha` is a valid command. Therefore, `alpha` is a valid value for the `julia-version` input to this action:
So, for example, suppose that you want alpha pre-releases for the next upcoming release. On your local machine, `juliaup add alpha` is a valid command. Therefore, `alpha` is a valid value for the `channel` input to this action:

```yaml
- uses: julia-actions/install-juliaup@v1
with:
julia-version: 'alpha'
channel: 'alpha'
```

See the [Juliaup README](https://github.com/JuliaLang/juliaup/blob/main/README.md#using-juliaup) for more examples.
Expand All @@ -50,7 +50,7 @@ For example, suppose that your GitHub Actions workflow file includes a job matri
```yaml
strategy:
matrix:
julia-version:
juliaup_channel:
- 'lts'
- '1.10'
- '1'
Expand All @@ -62,7 +62,7 @@ Then `install-juliaup` can use this job matrix as follows:
```yaml
- uses: julia-actions/install-juliaup@v1
with:
julia-version: ${{ matrix.julia-version }}
channel: ${{ matrix.juliaup_channel }}
```

### Calling `juliaup` directly
Expand All @@ -72,7 +72,7 @@ When the `install-juliaup` action runs, it adds `juliaup` to the PATH. Therefore
```yaml
- uses: julia-actions/install-juliaup@v1
with:
julia-version: '1'
channel: '1'

- run: juliaup status
- run: juliaup add 1.10
Expand Down
4 changes: 2 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ name: 'install-juliaup'
description: 'Install Juliaup, add it to the PATH, and use it to install Julia'
author: 'julia-actions organization, contributors'
inputs:
julia-version:
description: 'The Julia version to install'
channel:
description: 'The Juliaup channel to install (and set as the default channel).'
required: true
internal-juliaup-version:
description: '[private internal]. The Juliaup version to install. This is not part of the public API of this action.'
Expand Down
26 changes: 13 additions & 13 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,11 @@ var __importStar = (this && this.__importStar) || function (mod) {
return result;
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.isNonEmptyString = exports.get_juliaup_version_input = exports.get_julia_version_input = void 0;
exports.isNonEmptyString = exports.get_juliaup_version_input = exports.get_juliaup_channel_input = void 0;
// npm packages that are part of the GitHub Actions toolkit
const core = __importStar(__nccwpck_require__(2186));
function get_julia_version_input() {
const input_name = 'julia-version';
function get_juliaup_channel_input() {
const input_name = 'channel';
const original_version_input = core.getInput(input_name);
const version = original_version_input.trim();
if (version != original_version_input) {
Expand All @@ -80,7 +80,7 @@ function get_julia_version_input() {
}
return version;
}
exports.get_julia_version_input = get_julia_version_input;
exports.get_juliaup_channel_input = get_juliaup_channel_input;
function get_juliaup_version_input() {
const input_name = 'internal-juliaup-version';
const original_version_input = core.getInput(input_name);
Expand Down Expand Up @@ -132,23 +132,23 @@ var __importStar = (this && this.__importStar) || function (mod) {
return result;
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.install_desired_julia_version = void 0;
exports.install_desired_juliaup_channel = void 0;
// npm packages that are part of the GitHub Actions toolkit
// import * as core from '@actions/core'
const exec = __importStar(__nccwpck_require__(1514));
// Our own source code files
const inputs = __importStar(__nccwpck_require__(6180));
const platform = __importStar(__nccwpck_require__(9238));
async function install_desired_julia_version(info) {
async function install_desired_juliaup_channel(info) {
// Install the Julia desired version, and set it as the default.
const julia_version = inputs.get_julia_version_input();
const juliaup_channel = inputs.get_juliaup_channel_input();
const juliaup = platform.get_juliaup(info);
await exec.exec(juliaup, ['add', `${julia_version}`]);
await exec.exec(juliaup, ['update', `${julia_version}`]);
await exec.exec(juliaup, ['default', `${julia_version}`]);
await exec.exec(juliaup, ['add', `${juliaup_channel}`]);
await exec.exec(juliaup, ['update', `${juliaup_channel}`]);
await exec.exec(juliaup, ['default', `${juliaup_channel}`]);
return;
}
exports.install_desired_julia_version = install_desired_julia_version;
exports.install_desired_juliaup_channel = install_desired_juliaup_channel;
//# sourceMappingURL=julia.js.map

/***/ }),
Expand Down Expand Up @@ -398,14 +398,14 @@ const juliaup = __importStar(__nccwpck_require__(2635));
const platform = __importStar(__nccwpck_require__(9238));
async function main_function_run_me() {
// Step 1: Make sure all required inputs are provided.
inputs.get_julia_version_input();
inputs.get_juliaup_channel_input();
inputs.get_juliaup_version_input();
// Step 2: Ensure that Juliaup is installed.
const info = await juliaup.ensure_juliaup_is_installed();
// Step 3: Print the path of `juliaup`:
await print_debugging_juliaup_path(info);
// Step 4: Install the Julia desired version, and set it as the default.
await julia.install_desired_julia_version(info);
await julia.install_desired_juliaup_channel(info);
// Step 5: Print the path of `julia` (julialauncher):
await print_debugging_julialauncher_path(info);
return;
Expand Down
8 changes: 4 additions & 4 deletions lib/inputs.js

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

2 changes: 1 addition & 1 deletion lib/inputs.js.map

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

14 changes: 7 additions & 7 deletions lib/julia.js

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

2 changes: 1 addition & 1 deletion lib/julia.js.map

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

4 changes: 2 additions & 2 deletions lib/start_here.js

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

2 changes: 1 addition & 1 deletion lib/start_here.js.map

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

4 changes: 2 additions & 2 deletions src/inputs.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// npm packages that are part of the GitHub Actions toolkit
import * as core from '@actions/core'

export function get_julia_version_input() {
const input_name = 'julia-version'
export function get_juliaup_channel_input() {
const input_name = 'channel'
const original_version_input = core.getInput(input_name)
const version = original_version_input.trim()

Expand Down
10 changes: 5 additions & 5 deletions src/julia.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ import * as exec from '@actions/exec'
import * as inputs from './inputs'
import * as platform from './platform'

export async function install_desired_julia_version(info: { juliaup_dir: string}) {
export async function install_desired_juliaup_channel(info: { juliaup_dir: string}) {
// Install the Julia desired version, and set it as the default.

const julia_version = inputs.get_julia_version_input()
const juliaup_channel = inputs.get_juliaup_channel_input()
const juliaup = platform.get_juliaup(info)

await exec.exec(juliaup, ['add', `${julia_version}`])
await exec.exec(juliaup, ['update', `${julia_version}`])
await exec.exec(juliaup, ['default', `${julia_version}`])
await exec.exec(juliaup, ['add', `${juliaup_channel}`])
await exec.exec(juliaup, ['update', `${juliaup_channel}`])
await exec.exec(juliaup, ['default', `${juliaup_channel}`])

return
}
4 changes: 2 additions & 2 deletions src/start_here.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import * as platform from './platform'

export async function main_function_run_me() {
// Step 1: Make sure all required inputs are provided.
inputs.get_julia_version_input()
inputs.get_juliaup_channel_input()
inputs.get_juliaup_version_input()

// Step 2: Ensure that Juliaup is installed.
Expand All @@ -28,7 +28,7 @@ export async function main_function_run_me() {
await print_debugging_juliaup_path(info)

// Step 4: Install the Julia desired version, and set it as the default.
await julia.install_desired_julia_version(info)
await julia.install_desired_juliaup_channel(info)

// Step 5: Print the path of `julia` (julialauncher):
await print_debugging_julialauncher_path(info)
Expand Down