fix: fixup compute-file-server-cli dependency build (#1037) #797
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
push: | |
branches: | |
- main | |
env: | |
wasm-tools_version: 1.216.0 | |
name: release-please | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
outputs: | |
releases_created: ${{ steps.release.outputs.releases_created }} | |
pr: ${{ steps.release.outputs.pr }} | |
steps: | |
- uses: google-github-actions/release-please-action@v3 | |
id: release | |
with: | |
release-type: node | |
package-name: "@fastly/js-compute" | |
changelog-path: "CHANGELOG.md" | |
bump-minor-pre-major: true | |
bump-patch-for-minor-pre-major: true | |
draft: false | |
prerelease: false | |
token: ${{ secrets.GITHUB_TOKEN }} | |
update-lock-and-docs: | |
runs-on: ubuntu-latest | |
needs: release | |
if: ${{ needs.release.outputs.pr && !needs.release.outputs.releases_created }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
submodules: true | |
ref: release-please--branches--main--components--js-compute | |
fetch-depth: 2 | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 'lts/*' | |
- name: Cache Compute File Server CLI | |
id: cache-compute-file-server-cli | |
uses: actions/cache@v3 | |
with: | |
path: "/home/runner/.cargo/bin/compute-file-server-cli" | |
key: crate-cache-compute-file-server-cli | |
- name: Install Compute File Server CLI | |
if: steps.cache-compute-file-server-cli.outputs.cache-hit != 'true' | |
run: cargo install --path compute-file-server-cli | |
- run: npm update | |
working-directory: ./documentation | |
- run: npm run add-fastly-prefix | |
working-directory: ./documentation | |
- run: npm run docusaurus docs:version "$(npm pkg get version --json --prefix=../ | jq -r)" | |
working-directory: ./documentation | |
- run: npm update | |
working-directory: ./documentation/app | |
- run: npm run build:files | |
working-directory: ./documentation/app | |
- run: npm install && npm run format-changelog | |
- run: npm run remove-fastly-prefix | |
working-directory: ./documentation | |
- name: Committing and push changes | |
run: | | |
git config user.name "${GITHUB_ACTOR}" | |
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" | |
git add . | |
git commit -m "chore: add docs for $(npm pkg get version --json | jq -r)" | |
git push --force | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
needs: release | |
if: ${{ needs.release.outputs.releases_created }} | |
strategy: | |
matrix: | |
profile: [debug, release, weval] | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: true | |
- name: Install Rust 1.77.1 | |
run: | | |
rustup toolchain install 1.77.1 | |
rustup target add wasm32-wasi --toolchain 1.77.1 | |
- name: Restore wasm-tools from cache | |
uses: actions/cache@v3 | |
id: wasm-tools | |
with: | |
path: "/home/runner/.cargo/bin/wasm-tools" | |
key: crate-cache-wasm-tools-${{ env.wasm-tools_version }} | |
- name: Build | |
if: ${{ matrix.profile == 'release' }} | |
run: npm run build | |
- name: Build | |
if: ${{ matrix.profile == 'debug' }} | |
run: npm run build:debug | |
- name: Build | |
if: ${{ matrix.profile == 'weval' }} | |
run: npm run build:weval | |
- uses: actions/upload-artifact@v3 | |
with: | |
if-no-files-found: error | |
name: fastly-${{ matrix.profile }} | |
path: fastly${{ matrix.profile == 'debug' && '.debug.wasm' || (matrix.profile == 'weval' && '-weval.wasm' || '.wasm') }} | |
- uses: actions/upload-artifact@v3 | |
if: ${{ matrix.profile == 'weval' }} | |
with: | |
name: fastly-${{ matrix.profile }}-ic-cache | |
path: fastly-ics.wevalcache | |
publish: | |
runs-on: ubuntu-latest | |
needs: [release, build] | |
if: ${{ needs.release.outputs.releases_created }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: true | |
- name: Setup Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 'lts/*' | |
registry-url: 'https://registry.npmjs.org' | |
- name: Restore wasm-tools from cache | |
uses: actions/cache@v3 | |
id: wasm-tools | |
with: | |
path: "/home/runner/.cargo/bin/wasm-tools" | |
key: crate-cache-wasm-tools-${{ env.wasm-tools_version }} | |
- run: npm install --immutable | |
- name: Download Engine Release | |
uses: actions/download-artifact@v3 | |
with: | |
name: fastly-release | |
- name: Download Engine Debug | |
uses: actions/download-artifact@v3 | |
with: | |
name: fastly-debug | |
- name: Download Engine Weval | |
uses: actions/download-artifact@v3 | |
with: | |
name: fastly-weval | |
- name: Download Engine Weval Cache | |
uses: actions/download-artifact@v3 | |
with: | |
name: fastly-weval-ic-cache | |
- run: npm publish | |
env: | |
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} | |
- name: github package registry publish | |
run: | | |
cat << EOF > .npmrc | |
//npm.pkg.github.com/:_authToken=${GITHUB_TOKEN} | |
@fastly:registry=https://npm.pkg.github.com | |
registry=https://registry.npmjs.org/ | |
always-auth=true | |
EOF | |
npm publish | |
rm .npmrc | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- run: npm run add-fastly-prefix | |
working-directory: ./documentation | |
- run: npm ci | |
working-directory: ./documentation | |
- name: Set up Fastly CLI | |
uses: fastly/compute-actions/setup@v2 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
cli_version: '7.0.1' | |
- run: npm run deploy | |
timeout-minutes: 120 | |
env: | |
FASTLY_API_TOKEN: ${{secrets.FASTLY_API_TOKEN}} | |
working-directory: ./documentation |