-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
63 lines (63 loc) · 2.51 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
62
63
name: my-vcpkg-action
description: Simple action to run vcpkg and cache results
inputs:
pkgs:
description: "List of packages to build, separated by spaces"
required: true
triplet:
description: "vcpkg triplet to use"
required: true
extra-args:
description: "Extra vcpkg command line args (optional)"
required: false
cache-key:
description: "Additional cache key component (optional)"
required: false
disable-cache:
description: "Disable cache (useful for release builds)"
required: false
default: 'false'
revision:
description: "vcpkg revision to checkout."
required: false
default: ''
runs:
using: "composite"
steps:
- name: vcpkg-dry-run-win
if: runner.os == 'Windows'
working-directory: ${{ env.VCPKG_ROOT }}
shell: cmd
run: |
set VCPKG_DEFAULT_BINARY_CACHE=${{ github.workspace }}\vcpkg_cache_${{ inputs.cache-key }}
mkdir %VCPKG_DEFAULT_BINARY_CACHE%
"${{ env.VCPKG_ROOT }}\vcpkg.exe" install --dry-run --triplet ${{ inputs.triplet }} ${{ inputs.extra-args }} ${{ inputs.pkgs }} > vcpkg_dry_run.txt
- name: vcpkg-dry-run-unix
if: runner.os != 'Windows'
working-directory: ${{ env.VCPKG_ROOT }}
shell: bash
run: |
export VCPKG_DEFAULT_BINARY_CACHE=${{ github.workspace }}/vcpkg_cache_${{ inputs.cache-key }}
mkdir $VCPKG_DEFAULT_BINARY_CACHE
"${{ env.VCPKG_ROOT }}/vcpkg" install --dry-run --triplet ${{ inputs.triplet }} ${{ inputs.extra-args }} ${{ inputs.pkgs }} > vcpkg_dry_run.txt
- name: cache-vcpkg-archives
if: ${{ inputs.disable_cache != 'true' }}
id: cache-vcpkg-archives
uses: pat-s/always-upload-cache@v3
with:
path: ${{ github.workspace }}/vcpkg_cache_${{ inputs.cache-key }}
key: ${{ runner.os }}-${{ inputs.triplet }}-vcpkg-${{ hashFiles('${{ env.VCPKG_ROOT }}\vcpkg_dry_run.txt') }}
- name: build-vcpkg-win
if: runner.os == 'Windows'
shell: cmd
working-directory: ${{ env.VCPKG_ROOT }}
run: |
set VCPKG_DEFAULT_BINARY_CACHE=${{ github.workspace }}\vcpkg_cache_${{ inputs.cache-key }}
"${{ env.VCPKG_ROOT }}\vcpkg.exe" install --triplet ${{ inputs.triplet }} ${{ inputs.extra-args }} ${{ inputs.pkgs }}
- name: build-vcpkg-unix
if: runner.os != 'Windows'
shell: bash
working-directory: ${{ env.VCPKG_ROOT }}
run: |
export VCPKG_DEFAULT_BINARY_CACHE=${{ github.workspace }}/vcpkg_cache_${{ inputs.cache-key }}
"${{ env.VCPKG_ROOT }}/vcpkg" install --triplet ${{ inputs.triplet }} ${{ inputs.extra-args }} ${{ inputs.pkgs }}