Adding node/pip caching to ci - fix passing HAS_SECRET to build_windows (#291)
* spell HAVE_SECRET right - remove extra Azure Pipelines env var * Remove debug - cache pip * Add caching to macos and ubuntu * Key cache on setup.py - use pip to get cache dir * Remove macos, ubuntu "os" updates
This commit is contained in:
parent
dbde81f971
commit
2c00603441
5 changed files with 80 additions and 20 deletions
32
.github/workflows/build-macos.yml
vendored
32
.github/workflows/build-macos.yml
vendored
|
@ -27,6 +27,32 @@ jobs:
|
|||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
- name: Cache node modules
|
||||
uses: actions/cache@v2
|
||||
env:
|
||||
cache-name: cache-node-modules
|
||||
with:
|
||||
# npm cache files are stored in `~/.npm` on Linux/macOS
|
||||
path: ~/.npm
|
||||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-build-${{ env.cache-name }}-
|
||||
${{ runner.os }}-build-
|
||||
${{ runner.os }}-
|
||||
|
||||
- name: Get pip cache dir
|
||||
id: pip-cache
|
||||
run: |
|
||||
echo "::set-output name=dir::$(pip cache dir)"
|
||||
|
||||
- name: Cache pip
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ${{ steps.pip-cache.outputs.dir }}
|
||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pip-
|
||||
|
||||
- name: Test for secrets access
|
||||
id: check_secrets
|
||||
shell: bash
|
||||
|
@ -44,9 +70,9 @@ jobs:
|
|||
p12-file-base64: ${{ secrets.APPLE_DEV_ID_APP }}
|
||||
p12-password: ${{ secrets.APPLE_DEV_ID_APP_PASS }}
|
||||
|
||||
- name: Install MacOS dependencies
|
||||
run: |
|
||||
brew update
|
||||
# - name: Install MacOS dependencies
|
||||
# run: |
|
||||
# brew update
|
||||
|
||||
- name: Run install script
|
||||
env:
|
||||
|
|
27
.github/workflows/build-ubuntu.yml
vendored
27
.github/workflows/build-ubuntu.yml
vendored
|
@ -27,9 +27,34 @@ jobs:
|
|||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
- name: Cache node modules
|
||||
uses: actions/cache@v2
|
||||
env:
|
||||
cache-name: cache-node-modules
|
||||
with:
|
||||
# npm cache files are stored in `~/.npm` on Linux/macOS
|
||||
path: ~/.npm
|
||||
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-build-${{ env.cache-name }}-
|
||||
${{ runner.os }}-build-
|
||||
${{ runner.os }}-
|
||||
|
||||
- name: Get pip cache dir
|
||||
id: pip-cache
|
||||
run: |
|
||||
echo "::set-output name=dir::$(pip cache dir)"
|
||||
|
||||
- name: Cache pip
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ${{ steps.pip-cache.outputs.dir }}
|
||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pip-
|
||||
|
||||
- name: Install ubuntu dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install python${{ matrix.python-version }}-venv python${{ matrix.python-version }}-distutils git -y
|
||||
sudo apt-get install nodejs-dev node-gyp
|
||||
|
||||
|
|
13
.github/workflows/build-windows.yml
vendored
13
.github/workflows/build-windows.yml
vendored
|
@ -31,6 +31,19 @@ jobs:
|
|||
${{ runner.os }}-build-
|
||||
${{ runner.os }}-
|
||||
|
||||
- name: Get pip cache dir
|
||||
id: pip-cache
|
||||
run: |
|
||||
echo "::set-output name=dir::$(pip cache dir)"
|
||||
|
||||
- name: Cache pip
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ${{ steps.pip-cache.outputs.dir }}
|
||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pip-
|
||||
|
||||
- name: Test for secrets access
|
||||
id: check_secrets
|
||||
shell: bash
|
||||
|
|
|
@ -95,7 +95,6 @@ steps:
|
|||
sh build_macos.sh
|
||||
ls -l final_installer
|
||||
displayName: "Build DMG with build_scripts/build_macos.sh"
|
||||
env: { CHIA_INSTALLER_VERSION: "0.1.6" }
|
||||
|
||||
- task: PublishPipelineArtifact@1
|
||||
inputs:
|
||||
|
|
|
@ -94,10 +94,7 @@ Write-Output "node winstaller.js"
|
|||
node winstaller.js
|
||||
Write-Output " ---"
|
||||
|
||||
Write-Output "HAS SECRET is:"
|
||||
Get-Childitem env:HAS_SECRET
|
||||
|
||||
If ($env:HAS_SECRETS -eq "true") {
|
||||
If ($env:HAS_SECRET) {
|
||||
Write-Output " ---"
|
||||
Write-Output "Add timestamp and verify signature"
|
||||
Write-Output " ---"
|
||||
|
|
Loading…
Reference in a new issue