This repository was archived by the owner on Jul 4, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yml
More file actions
65 lines (61 loc) · 2.07 KB
/
action.yml
File metadata and controls
65 lines (61 loc) · 2.07 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
name: "Raise.dev Version Uploader"
author: Raise.dev
branding:
color: yellow
icon: upload-cloud
description: "Raise's GitHub Action for uploading Versions to the Raise.dev Console."
inputs:
workspace:
description: "The name of the Workspace"
required: true
firmware:
description: "The name of the Firmware"
required: true
binary:
description: "The path of the binary file to upload"
required: true
name:
description: "The name of the Version (defaults to `git describe` output). Must be unique within a Firmware."
required: false
outputs:
name:
description: "The name of the newly uploaded Version"
value: ${{ steps.version-json.outputs.name }}
show-url:
description: "The URL of the newly uploaded Version page"
value: ${{ steps.version-json.outputs.show-url }}
binary-url:
description: "The URL of the newly uploaded Version binary for download"
value: ${{ steps.version-json.outputs.binary-url }}
runs:
using: "composite"
steps:
- id: set-name
run: |
# Set name input
set -e
name="${{ inputs.name }}"
if [[ -z "${name}" ]]; then
name="$(git describe --tags --always)"
fi
echo "name=${name}" | tee -a ${GITHUB_OUTPUT}
shell: bash
- run: |
# Make API call to Raise.dev
set -e
set -x
curl --fail-with-body \
--form "workflow_run_id=${{ github.run_id }}" \
--form "version[name]=${{ steps.set-name.outputs.name }}" \
--form "version[binary]=@${{ inputs.binary }}" \
https://console.raise.dev/workspaces/${{ inputs.workspace }}/firmwares/${{ inputs.firmware }}/v.json \
| tee version.json
shell: bash
- id: version-json
run: |
# Set outputs
set -e
echo "name=$(jq --raw-output ".name" version.json)" | tee -a ${GITHUB_OUTPUT}
echo "show-url=$(jq --raw-output ".show_url" version.json)" | tee -a ${GITHUB_OUTPUT}
echo "binary-url=$(jq --raw-output ".binary_url" version.json)" | tee -a ${GITHUB_OUTPUT}
shell: bash