-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yml
More file actions
65 lines (58 loc) · 2.19 KB
/
action.yml
File metadata and controls
65 lines (58 loc) · 2.19 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: "Setup Codee"
description: "Setup Codee Analyzer & Formatter"
author: "Igor S. Gerasimov"
inputs:
version:
description: "Version of Codee"
required: false
default: 2025.3.8
runs:
using: composite
steps:
- name: Check platform compability
if: ${{ !((runner.os == 'Windows' && runner.arch == 'X64') || (runner.os == 'Linux' && (runner.arch == 'X64' || runner.arch == 'ARM64'))) }}
shell: bash
run: |
echo "Not supported combination of OS & Arch: ${{ runner.os }} & ${{ runner.arch }}"
exit 1
- name: Match runner platform with Codee artifact
id: mapping
shell: bash
run: |
case "${{ runner.os }}-${{ runner.arch }}" in
"Windows-X64")
archive_name=windows-amd64
archive_extension=zip
;;
"Linux-X64")
archive_name=linux-x86_64
archive_extension=tar.gz
;;
"Linux-ARM64")
archive_name=linux-aarch64
archive_extension=tar.gz
;;
*)
exit 1
;;
esac
echo "codee_archive=${archive_name}" >> $GITHUB_OUTPUT
echo "codee_archive_extension=${archive_extension}" >> $GITHUB_OUTPUT
- name: Download Codee artifact
shell: bash
run: |
curl -L -o ${RUNNER_TEMP}/codee.${{ steps.mapping.outputs.codee_archive_extension }} https://codee.com/release/codee-${{ inputs.version }}-${{ steps.mapping.outputs.codee_archive }}.${{ steps.mapping.outputs.codee_archive_extension }}
- name: Extract Codee artifact
shell: bash
run: |
if [[ "${{ steps.mapping.outputs.codee_archive_extension }}" == "zip" ]]; then
unzip -qq ${RUNNER_TEMP}/codee.zip -d ${RUNNER_TEMP}/codee-tmp
mv ${RUNNER_TEMP}/codee-tmp/codee-${{ inputs.version }}-${{ steps.mapping.outputs.codee_archive }}/ ${RUNNER_TEMP}/codee/
rm -rf ${RUNNER_TEMP}/codee-tmp
else
mkdir -p ${RUNNER_TEMP}/codee/
tar --strip-components=1 -xzf ${RUNNER_TEMP}/codee.tar.gz -C ${RUNNER_TEMP}/codee
fi
- name: Add Codee binaries to PATH
shell: bash
run: echo "${RUNNER_TEMP}/codee/bin" >> $GITHUB_PATH