ci: Add oasis-install #9
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: install-oasis | ||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| release_tag: | ||
| description: 'Specific release tag to install (defaults to latest)' | ||
| required: false | ||
| type: string | ||
| # A push occurs to one of the matched branches. | ||
| push: | ||
| branches: | ||
| - master | ||
| - stable/* | ||
| # Or when a pull request event occurs for a pull request against one of the | ||
| # matched branches. | ||
| pull_request: | ||
| branches: | ||
| - master | ||
| - stable/* | ||
| jobs: | ||
| install: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Install Oasis CLI (latest or pinned) | ||
| run: | | ||
| TAG="${{ inputs.release_tag }}" | ||
| echo "Input length: ${#TAG}" | ||
| API="https://github.com/oasisprotocol/cli/releases/download/v0.16.0/oasis_cli_0.16.0_linux_amd64.tar.gz" | ||
| echo "Fetching release info from: $API" | ||
| # ...same download logic... | ||
| curl -L "$API" -o oasis-cli.tar.gz | ||
| tar -xzf oasis-cli.tar.gz | ||
| rm oasis-cli.tar.gz | ||
| # Make executable | ||
| chmod +x oasis | ||
| # Verify installation | ||
| ./oasis --version | ||
| - name: Debug inputs | ||
| run: | | ||
| echo "Raw input: '${{ inputs.release_tag }}'" | ||
| echo "Input length: ${#TAG}" | ||
| TAG="${{ inputs.release_tag }}" | ||
| if [ -z "$TAG" ]; then | ||
| echo "TAG is empty or unset" | ||
| else | ||
| echo "TAG is set to: '$TAG'" | ||
| fi | ||
| - name: Determine release tag | ||
| id: tag | ||
| run: | | ||
| TAG="${{ inputs.release_tag }}" | ||
| if [ -z "$TAG" ]; then | ||
| echo "No input tag provided → using latest release." | ||
| TAG=$(curl -fsSL https://api.github.com/repos/oasisprotocol/cli/releases/latest | jq -r .tag_name) | ||
| fi | ||
| echo "tag=$TAG" >> $GITHUB_OUTPUT | ||
| - name: Expose PATH | ||
| run: echo "$PWD" >> "$GITHUB_PATH" | ||
| - name: Verify installation | ||
| run: | | ||
| echo "Oasis CLI installed successfully!" | ||
| oasis --version | ||