Skip to content

Commit a20ee17

Browse files
committed
fix: add binary caching to github runners
Signed-off-by: Gordon Smith <GordonJSmith@gmail.com>
1 parent 6fb0c32 commit a20ee17

File tree

4 files changed

+82
-4
lines changed

4 files changed

+82
-4
lines changed

.github/workflows/deploy-docs.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
name: Deploy vitepress content to Pages (deploy-docs.yml)
22

3+
permissions:
4+
packages: write
5+
contents: write
6+
pages: write
7+
8+
env:
9+
VCPKG_BINARY_SOURCES: "clear;nuget,GitHub,readwrite"
10+
VCPKG_NUGET_REPOSITORY: https://github.com/hpcc-systems/hpcc-js-wasm
11+
312
on:
413
push:
514
branches:
@@ -25,6 +34,7 @@ jobs:
2534
sudo apt-get install -y gcc-multilib g++-multilib pkg-config autoconf bison libtool flex
2635
sudo apt-get install -y python3 python3-pip
2736
sudo apt-get install -y chromium
37+
sudo apt-get install -y mono-complete
2838
2939
- name: Export GitHub Actions cache environment variables
3040
uses: actions/github-script@v7
@@ -41,6 +51,24 @@ jobs:
4151
run: |
4252
npm run install-build-deps
4353
54+
- name: Make nuget.exe executable
55+
run: |
56+
NUGET_PATH=$(./vcpkg/vcpkg fetch nuget | tail -n 1)
57+
chmod +x "$NUGET_PATH"
58+
59+
- name: Setup vcpkg NuGet authentication
60+
run: |
61+
mono `./vcpkg/vcpkg fetch nuget | tail -n 1` \
62+
sources add \
63+
-source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" \
64+
-storepasswordincleartext \
65+
-name "GitHub" \
66+
-username "${{ github.repository_owner }}" \
67+
-password "${{ secrets.GITHUB_TOKEN }}"
68+
mono `./vcpkg/vcpkg fetch nuget | tail -n 1` \
69+
setapikey "${{ secrets.GITHUB_TOKEN }}" \
70+
-source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json"
71+
4472
- name: Build
4573
run: |
4674
npm run build

.github/workflows/release-please.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
name: Release Please (release-please.yml)
22

3+
env:
4+
VCPKG_BINARY_SOURCES: "clear;nuget,GitHub,readwrite"
5+
VCPKG_NUGET_REPOSITORY: https://github.com/hpcc-systems/hpcc-js-wasm
6+
37
on:
48
push:
59
branches:
@@ -8,6 +12,7 @@ on:
812
permissions:
913
contents: write
1014
pull-requests: write
15+
packages: write
1116

1217
jobs:
1318
release-please:
@@ -42,6 +47,7 @@ jobs:
4247
sudo apt-get install -y git cmake ninja-build wget zip
4348
sudo apt-get install -y gcc-multilib g++-multilib pkg-config autoconf bison libtool flex
4449
sudo apt-get install -y python3 python3-pip
50+
sudo apt-get install -y mono-complete
4551
4652
- name: Export GitHub Actions cache environment variables
4753
if: ${{ steps.release.outputs.release_created }}
@@ -58,6 +64,26 @@ jobs:
5864
sudo npx playwright install chromium --with-deps
5965
npm run install-build-deps
6066
67+
- name: Make nuget.exe executable
68+
if: ${{ steps.release.outputs.release_created }}
69+
run: |
70+
NUGET_PATH=$(./vcpkg/vcpkg fetch nuget | tail -n 1)
71+
chmod +x "$NUGET_PATH"
72+
73+
- name: Setup vcpkg NuGet authentication
74+
if: ${{ steps.release.outputs.release_created }}
75+
run: |
76+
mono `./vcpkg/vcpkg fetch nuget | tail -n 1` \
77+
sources add \
78+
-source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" \
79+
-storepasswordincleartext \
80+
-name "GitHub" \
81+
-username "${{ github.repository_owner }}" \
82+
-password "${{ secrets.GITHUB_TOKEN }}"
83+
mono `./vcpkg/vcpkg fetch nuget | tail -n 1` \
84+
setapikey "${{ secrets.GITHUB_TOKEN }}" \
85+
-source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json"
86+
6187
- name: Lint
6288
if: ${{ steps.release.outputs.release_created }}
6389
run: |

.github/workflows/test-pr.yml

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
name: Test PR (test-pr.yml)
22

3+
permissions:
4+
packages: write
5+
contents: read
6+
37
env:
4-
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite"
8+
VCPKG_BINARY_SOURCES: "clear;nuget,GitHub,readwrite"
9+
VCPKG_NUGET_REPOSITORY: https://github.com/hpcc-systems/hpcc-js-wasm
510

611
on:
712
pull_request:
@@ -38,11 +43,12 @@ jobs:
3843
sudo apt-get install -y git cmake ninja-build wget zip
3944
sudo apt-get install -y gcc-multilib g++-multilib pkg-config autoconf bison libtool flex
4045
sudo apt-get install -y python3 python3-pip
46+
sudo apt-get install -y mono-complete
4147
4248
- name: Install OSX Dependencies
4349
if: ${{ contains(matrix.os, 'macos') }}
4450
run: |
45-
brew install ninja flex bison automake autoconf-archive coreutils
51+
brew install ninja flex bison automake autoconf-archive coreutils mono
4652
if [[ $(uname -m) == 'arm64' ]]; then
4753
echo "PATH=/opt/homebrew/opt/bison/bin:/opt/homebrew/opt/flex/bin:$PATH" >> $GITHUB_ENV
4854
else
@@ -70,6 +76,24 @@ jobs:
7076
run: |
7177
npm run install-build-deps
7278
79+
- name: Make nuget.exe executable
80+
run: |
81+
NUGET_PATH=$(./vcpkg/vcpkg fetch nuget | tail -n 1)
82+
chmod +x "$NUGET_PATH"
83+
84+
- name: Setup vcpkg NuGet authentication
85+
run: |
86+
mono `./vcpkg/vcpkg fetch nuget | tail -n 1` \
87+
sources add \
88+
-source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json" \
89+
-storepasswordincleartext \
90+
-name "GitHub" \
91+
-username "${{ github.repository_owner }}" \
92+
-password "${{ secrets.GITHUB_TOKEN }}"
93+
mono `./vcpkg/vcpkg fetch nuget | tail -n 1` \
94+
setapikey "${{ secrets.GITHUB_TOKEN }}" \
95+
-source "https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json"
96+
7397
- name: Lint
7498
run: |
7599
npm run lint

scripts/cpp-install-vcpkg.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ cd ./vcpkg
1212
git checkout $VCPKG_BUILD_TOOLS_VERSION
1313
./bootstrap-vcpkg.sh
1414
cd ..
15-
source ./emsdk/emsdk_env.sh
16-
./vcpkg/vcpkg install --triplet=wasm32-emscripten --x-abi-tools-use-exact-versions --downloads-root=./build/vcpkg_downloads --x-buildtrees-root=./build/vcpkg_buildtrees --x-packages-root=./build/vcpkg_packages --x-install-root=./build/vcpkg_installed
15+
# source ./emsdk/emsdk_env.sh
16+
# ./vcpkg/vcpkg install --triplet=wasm32-emscripten --x-abi-tools-use-exact-versions --downloads-root=./build/vcpkg_downloads --x-buildtrees-root=./build/vcpkg_buildtrees --x-packages-root=./build/vcpkg_packages --x-install-root=./build/vcpkg_installed

0 commit comments

Comments
 (0)