-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
61 lines (53 loc) · 1.82 KB
/
action.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
56
57
58
59
60
61
name: "Unidoc install"
description: "Install Swift Unidoc"
branding:
icon: check-circle
color: green
inputs:
unidoc-version:
description: "The version of Unidoc to use"
required: false
default: "0.21.0"
runs:
using: composite
steps:
- name: Create installation directory
shell: bash
run: |
mkdir -p ~/unidoc/bin
- name: Cache Unidoc
id: cache
uses: actions/cache@v4
with:
path: "~/unidoc/bin/unidoc.tar.gz"
key: "unidoc:${{ runner.os }}-${{ runner.arch }}/${{ inputs.unidoc-version }}"
- name: Detect Platform
shell: bash
if: runner.os == 'Linux'
run: |
echo "UNIDOC_PLATFORM=Ubuntu-24.04-${{ runner.arch }}" >> $GITHUB_ENV
- name: Detect Platform
shell: bash
if: runner.os == 'macOS'
run: |
echo "UNIDOC_PLATFORM=${{ runner.os }}-${{ runner.arch }}" >> $GITHUB_ENV
- name: Download Unidoc
shell: bash
if: steps.cache.outputs.cache-hit != 'true'
env:
UNIDOC_VERSION: ${{ inputs.unidoc-version }}
UNIDOC_MIRROR: "https://download.swiftinit.org/unidoc"
run: |
curl -L $UNIDOC_MIRROR/$UNIDOC_VERSION/$UNIDOC_PLATFORM/unidoc.tar.gz \
-o ~/unidoc/bin/unidoc.tar.gz
- name: Install Unidoc
shell: bash
run: |
tar -C ~/unidoc/bin/ -xf ~/unidoc/bin/unidoc.tar.gz
echo "$HOME/unidoc/bin" >> $GITHUB_PATH
- name: Check Unidoc
shell: bash
run: |
cat $GITHUB_PATH
unidoc --version
unidoc --help