-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yml
More file actions
82 lines (74 loc) · 2.59 KB
/
Copy pathaction.yml
File metadata and controls
82 lines (74 loc) · 2.59 KB
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
name: Install Release Binary
description: Download a binary attached to a GitHub Release and add it to the path
inputs:
owner:
description: The GitHub user or organisation hosting the repository
required: true
repository:
description: The name of the repository
required: true
binary-name:
description: The name of the binary you want to download
required: true
windows-suffix:
description: The suffix to add to Windows binaries
required: false
default: x86_64-pc-windows-msvc
linux-suffix:
description: The suffix to add to Linux binaries
required: false
default: x86_64-unknown-linux-gnu
macos-suffix:
description: The suffix to add to macOS binaries
required: false
default: x86_64-apple-darwin
macos-arm-suffix:
description: The suffix to add to macOS ARM binaries
required: false
default: aarch64-apple-darwin
version:
description: The required release version
required: false
default: latest
runs:
using: composite
steps:
- name: Determin Binary Name
id: get-binary-name
uses: tomphp/github-actions/determine-binary-name@v0.6.0
with:
name: ${{ inputs.binary-name }}
windows-suffix: ${{ inputs.windows-suffix }}
linux-suffix: ${{ inputs.linux-suffix }}
macos-suffix: ${{ inputs.macos-suffix }}
macos-arm-suffix: ${{ inputs.macos-arm-suffix }}
- name: Determine Release URL
id: get-release-url
uses: tomphp/github-actions/determine-release-url@v0.6.0
with:
owner: ${{ inputs.owner }}
repository: ${{ inputs.repository }}
version: ${{ inputs.version }}
binary-name: ${{ inputs.binary-name }}
windows-suffix: ${{ inputs.windows-suffix }}
linux-suffix: ${{ inputs.linux-suffix }}
macos-suffix: ${{ inputs.macos-suffix }}
macos-arm-suffix: ${{ inputs.macos-arm-suffix }}
- name: Install Binary
id: install
env:
BIN_FOLDER: ${{ inputs.binary-name }}-bin
SOURCE_URL: ${{ steps.get-release-url.outputs.url }}
TARGET_FILE: ${{ steps.get-binary-name.outputs.name }}
GITHUB_TOKEN: ${{ github.token }}
GITHUB_ACTOR: ${{ github.actor }}
run: |
set -euo pipefail
BIN_FOLDER="$RUNNER_TEMP/$BIN_FOLDER"
mkdir -p "$BIN_FOLDER"
curl -u "$GITHUB_ACTOR:$GITHUB_TOKEN" -Lo "$BIN_FOLDER/$TARGET_FILE" "$SOURCE_URL"
chmod +x "$BIN_FOLDER/$TARGET_FILE"
echo "Installed in $BIN_FOLDER/$TARGET_FILE"
sum "$BIN_FOLDER/$TARGET_FILE"
echo "$BIN_FOLDER/" >> "$GITHUB_PATH"
shell: bash