File tree Expand file tree Collapse file tree 2 files changed +72
-0
lines changed
Expand file tree Collapse file tree 2 files changed +72
-0
lines changed Original file line number Diff line number Diff line change 1+ name : install-oasis
2+ on :
3+ workflow_call :
4+ inputs :
5+ release_tag :
6+ description : ' Specific release tag to install (defaults to latest)'
7+ required : false
8+ type : string
9+ # A push occurs to one of the matched branches.
10+ push :
11+ branches :
12+ - master
13+ - stable/*
14+ # Or when a pull request event occurs for a pull request against one of the
15+ # matched branches.
16+ pull_request :
17+ branches :
18+ - master
19+ - stable/*
20+ jobs :
21+ install :
22+ runs-on : ubuntu-latest
23+ steps :
24+ - name : Install Oasis CLI (latest or pinned)
25+ run : |
26+ TAG="${{ inputs.release_tag }}"
27+ echo "Input length: ${#TAG}"
28+ API="https://github.com/oasisprotocol/cli/releases/download/v0.16.0/oasis_cli_0.16.0_linux_amd64.tar.gz"
29+
30+
31+ echo "Fetching release info from: $API"
32+ # ...same download logic...
33+ curl -L "$API_URL" -o oasis-cli.tar.gz
34+ tar -xzf oasis-cli.tar.gz
35+ rm oasis-cli.tar.gz
36+
37+ # Make executable
38+ chmod +x oasis
39+
40+ # Verify installation
41+ ./oasis --version
42+
43+ - name : Debug inputs
44+ run : |
45+ echo "Raw input: '${{ inputs.release_tag }}'"
46+ echo "Input length: ${#TAG}"
47+ TAG="${{ inputs.release_tag }}"
48+ if [ -z "$TAG" ]; then
49+ echo "TAG is empty or unset"
50+ else
51+ echo "TAG is set to: '$TAG'"
52+ fi
53+ - name : Determine release tag
54+ id : tag
55+ run : |
56+ TAG="${{ inputs.release_tag }}"
57+ if [ -z "$TAG" ]; then
58+ echo "No input tag provided → using latest release."
59+ TAG=$(curl -fsSL https://api.github.com/repos/oasisprotocol/cli/releases/latest | jq -r .tag_name)
60+ fi
61+ echo "tag=$TAG" >> $GITHUB_OUTPUT
62+ - name : Expose PATH
63+ run : echo "$PWD" >> "$GITHUB_PATH"
64+ - name : Verify installation
65+ run : |
66+ echo "Oasis CLI installed successfully!"
67+ oasis --version
Original file line number Diff line number Diff line change 1+ jobs :
2+ use-oasis-cli :
3+ uses : your-org/ci/.github/workflows/install-oasis.yml@main
4+ with :
5+ release_tag : v0.16.0
You can’t perform that action at this time.
0 commit comments