-
Notifications
You must be signed in to change notification settings - Fork 63
55 lines (54 loc) · 1.8 KB
/
integration-install.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: Install Script Integration Test
on:
pull_request:
branches: [ main ]
jobs:
install:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
permissions:
actions: read
contents: read
deployments: read
packages: none
steps:
- uses: actions/checkout@v4
- name: Get Draft Cli version
uses: actions/github-script@v7
id: get_draft_version
with:
result-encoding: string
retries : 3
script: |
const tag_url = context.payload.repository.releases_url.replace('{/id}', '/latest');
const response = await github.request(tag_url);
return response.data.tag_name;
- name: Run Install Script
shell: bash
run: ./scripts/install.sh
env:
DRAFT_CLI_VERSION: ${{ steps.get_draft_version.outputs.result }}
- name: Validate Command is Installed
shell: bash
run: |
if command -v /home/runner/.local/bin/draft &> /dev/null
then
echo "install_dir=/home/runner/.local/bin/draft" >> $GITHUB_ENV
elif command -v /usr/local/bin/draft &> /dev/null
then
echo "install_dir=/usr/local/bin/draft" >> $GITHUB_ENV
elif command -v /c/Users/runneradmin/.local/bin/draft &> /dev/null
then
echo "install_dir=/c/Users/runneradmin/.local/bin/draft" >> $GITHUB_ENV
elif command -v /Users/runner/.local/bin/draft &> /dev/null
then
echo "install_dir=/Users/runner/.local/bin/draft" >> $GITHUB_ENV
else
echo "draft could not be found"
exit 1
fi
- name: Validate Draft Command Runs
shell: bash
run: ${{ env.install_dir }} -h