|
1 | 1 | name: "Setup Probitas" |
2 | | -description: "Setup Probitas by installing Probitas CLI and adding it to the path." |
| 2 | +description: "Setup Probitas by installing Deno and Probitas CLI, and adding them to the path." |
3 | 3 | author: "JSR Probitas" |
4 | 4 | branding: |
5 | 5 | icon: "check-circle" |
6 | 6 | color: "green" |
7 | 7 |
|
8 | 8 | inputs: |
| 9 | + deno-version: |
| 10 | + description: "The Deno version to install. Can be a semver version, 'canary', 'lts', 'rc', or 'stable'." |
| 11 | + default: "stable" |
9 | 12 | probitas-version: |
10 | 13 | description: "The Probitas version to install. Can be a semver version or 'latest'." |
11 | 14 | default: "latest" |
| 15 | + cache: |
| 16 | + description: "Cache downloaded modules & packages automatically in GitHub Actions cache." |
| 17 | + default: "true" |
| 18 | + cache-hash: |
| 19 | + description: "A hash used as part of the cache key, which defaults to a hash of the deno.lock files." |
12 | 20 |
|
13 | 21 | outputs: |
| 22 | + cache-hit: |
| 23 | + description: "A boolean indicating whether the cache was hit." |
| 24 | + value: ${{ steps.setup-deno.outputs.cache-hit }} |
| 25 | + deno-version: |
| 26 | + description: "The Deno version that was installed." |
| 27 | + value: ${{ steps.setup-deno.outputs.deno-version }} |
14 | 28 | probitas-version: |
15 | 29 | description: "The Probitas version that was installed." |
16 | | - value: ${{ steps.verify-probitas.outputs.probitas-version }} |
| 30 | + value: ${{ steps.install-probitas.outputs.probitas-version }} |
17 | 31 |
|
18 | 32 | runs: |
19 | 33 | using: "composite" |
20 | 34 | steps: |
| 35 | + - name: Setup Deno |
| 36 | + id: setup-deno |
| 37 | + uses: denoland/setup-deno@v2 |
| 38 | + with: |
| 39 | + deno-version: ${{ inputs.deno-version }} |
| 40 | + cache: ${{ inputs.cache }} |
| 41 | + cache-hash: ${{ inputs.cache-hash }} |
| 42 | + |
21 | 43 | - name: Install Probitas CLI |
22 | 44 | id: install-probitas |
23 | 45 | shell: bash |
24 | 46 | env: |
25 | 47 | PROBITAS_VERSION: ${{ inputs.probitas-version != 'latest' && inputs.probitas-version || '' }} |
26 | | - PROBITAS_INSTALL_DIR: ${{ runner.temp }}/probitas-bin |
27 | 48 | run: | |
28 | 49 | echo "Installing Probitas CLI${PROBITAS_VERSION:+ version $PROBITAS_VERSION}..." |
29 | | - curl -fsSL https://raw.githubusercontent.com/jsr-probitas/cli/main/install.sh | bash |
30 | | -
|
31 | | - # Add to PATH |
32 | | - echo "$PROBITAS_INSTALL_DIR" >> $GITHUB_PATH |
| 50 | + curl -fsSL https://raw.githubusercontent.com/jsr-probitas/cli/main/install.sh | sh |
33 | 51 |
|
34 | | - - name: Verify Probitas |
35 | | - id: verify-probitas |
36 | | - shell: bash |
37 | | - env: |
38 | | - PROBITAS_INSTALL_DIR: ${{ runner.temp }}/probitas-bin |
39 | | - run: | |
40 | 52 | # Verify installation |
41 | | - if ! "$PROBITAS_INSTALL_DIR/probitas" --version &> /dev/null; then |
| 53 | + if ! command -v probitas &> /dev/null; then |
42 | 54 | echo "Error: Probitas CLI installation failed" |
43 | 55 | exit 1 |
44 | 56 | fi |
45 | 57 |
|
46 | 58 | # Get installed version |
47 | | - INSTALLED_VERSION=$("$PROBITAS_INSTALL_DIR/probitas" --version 2>&1 | head -n 1) |
| 59 | + INSTALLED_VERSION=$(probitas --version 2>&1 | head -n 1) |
48 | 60 | echo "Installed: $INSTALLED_VERSION" |
49 | 61 | echo "probitas-version=$INSTALLED_VERSION" >> $GITHUB_OUTPUT |
| 62 | +
|
| 63 | + - name: Verify Probitas |
| 64 | + shell: bash |
| 65 | + run: | |
| 66 | + echo "Probitas CLI is ready:" |
| 67 | + probitas --version |
0 commit comments