From 654b373e92651bddcc2660a0e6301b719fe42e29 Mon Sep 17 00:00:00 2001 From: Cody Brouwers <11965195+codybrouwers@users.noreply.github.com> Date: Mon, 16 Sep 2024 16:06:12 -0400 Subject: [PATCH] Add canary release process (#37) * Create pre-release.yml * Rename release workflow * Create .node-version * Disable on push * Update pre-release.yml --- .github/workflows/pre-release.yml | 51 +++++++++++++++++++++++ .github/workflows/{ci.yml => release.yml} | 9 ++-- .node-version | 1 + 3 files changed, 55 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/pre-release.yml rename .github/workflows/{ci.yml => release.yml} (88%) create mode 100644 .node-version diff --git a/.github/workflows/pre-release.yml b/.github/workflows/pre-release.yml new file mode 100644 index 0000000..dd9a328 --- /dev/null +++ b/.github/workflows/pre-release.yml @@ -0,0 +1,51 @@ +name: "Build and Publish Vercel Deployment Extension" + +on: + workflow_dispatch: + +jobs: + build-and-publish: + runs-on: "ubuntu-latest" + steps: + - uses: actions/checkout@v3 + + - name: Install Node.js + uses: actions/setup-node@v4 + with: + node-version-file: ".node-version" + + - uses: pnpm/action-setup@v2 + name: Install pnpm + id: pnpm-install + with: + version: 8.3.1 + run_install: false + + - name: Get pnpm store directory + id: pnpm-cache + shell: bash + run: | + echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT + + - uses: actions/cache@v3 + name: Setup pnpm cache + with: + path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-pnpm-store- + + - name: Install dependencies + run: pnpm install + + - name: Set to preview version + run: | + jq '. += { "id": "vercel-deployment-extension-preview", "name": "Vercel Deployment Extension (Preview)", "public": false, "galleryFlags": ["Preview"] }' vss-extension.json > temp.json \ + && mv temp.json vss-extension.json \ + && pnpm exec prettier --write vss-extension.json + echo "Updated vss-extension.json" + + - name: Build and Publish + run: pnpm -C scripts build-and-publish + env: + AZURE_TOKEN: ${{ secrets.AZURE_TOKEN }} diff --git a/.github/workflows/ci.yml b/.github/workflows/release.yml similarity index 88% rename from .github/workflows/ci.yml rename to .github/workflows/release.yml index 5cc9136..1090f16 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/release.yml @@ -2,9 +2,6 @@ name: "Build and Publish Vercel Deployment Extension" on: workflow_dispatch: - push: - branches: - - main jobs: build-and-publish: @@ -12,10 +9,10 @@ jobs: steps: - uses: actions/checkout@v3 - - name: Install Node.js 16 - uses: actions/setup-node@v3 + - name: Install Node.js + uses: actions/setup-node@v4 with: - node-version: 16.x + node-version-file: '.node-version' - uses: pnpm/action-setup@v2 name: Install pnpm diff --git a/.node-version b/.node-version new file mode 100644 index 0000000..6f7f377 --- /dev/null +++ b/.node-version @@ -0,0 +1 @@ +v16