-
Notifications
You must be signed in to change notification settings - Fork 25
/
action.yml
55 lines (55 loc) · 2.04 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
name: 'Setup Vcpkg'
description: 'Clone and bootstrap vcpkg'
inputs:
vcpkg-path:
description: 'Relative path under $GITHUB_WORKSPACE to the vcpkg repository'
required: true
github_token:
description: 'github token'
required: true
runs:
using: "composite"
steps:
- uses: actions/checkout@v3
with:
path: ${{ inputs.vcpkg-path }}
repository: microsoft/vcpkg
fetch-depth: 0
- if: runner.os != 'Windows'
run: "echo VCPKG_ROOT=${{ github.workspace }}/${{ inputs.vcpkg-path }} >> $GITHUB_ENV"
shell: bash
working-directory: ${{ inputs.vcpkg-path }}
- if: runner.os == 'Windows'
run: |
echo "VCPKG_ROOT=${{ github.workspace }}/${{ inputs.vcpkg-path }}" | Out-File -FilePath $env:GITHUB_ENV -Append
shell: powershell
working-directory: ${{ inputs.vcpkg-path }}
- if: runner.os == 'Linux'
run: sudo eatmydata "./bootstrap-vcpkg.sh"
shell: bash
working-directory: ${{ inputs.vcpkg-path }}
- if: runner.os == 'Windows'
run: .\bootstrap-vcpkg.bat
shell: powershell
working-directory: ${{ inputs.vcpkg-path }}
- name: Setup NuGet API key
shell: bash
run: >
$( type -p mono || :) `vcpkg fetch nuget | tail -n 1`
setapikey "${{ inputs.github_token }}"
-source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json"
working-directory: ${{ inputs.vcpkg-path }}
- run: echo "VCPKG_BINARY_SOURCES=clear;nuget,GitHub,readwrite" >> $GITHUB_ENV
shell: bash
- name: 'Setup NuGet Credentials'
shell: bash
run: >
mono=$( type -p mono || :);
nuget="$mono $(vcpkg fetch nuget | tail -n 1)";
$nuget sources list | grep -q ${{ github.repository_owner }} || $nuget sources add
-source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json"
-storepasswordincleartext
-name "GitHub"
-username "heroiclabs"
-password "${{ inputs.github_token }}"
working-directory: ${{ inputs.vcpkg-path }}