From 63dc60124c4e9e2127980ec55c289cf9aaf6d35f Mon Sep 17 00:00:00 2001 From: Aryan Goyal <137564277+ary82@users.noreply.github.com> Date: Wed, 2 Oct 2024 20:54:19 +0530 Subject: [PATCH] ci(chrome_extension): add release workflow Signed-off-by: Aryan Goyal <137564277+ary82@users.noreply.github.com> --- .github/workflows/backend.yml | 8 ++--- .github/workflows/release.yml | 36 +++++++++++++++++++++ chromium/socratic-code/static/manifest.json | 2 +- 3 files changed, 40 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/backend.yml b/.github/workflows/backend.yml index 2879846..40c98d4 100644 --- a/.github/workflows/backend.yml +++ b/.github/workflows/backend.yml @@ -7,9 +7,9 @@ name: Docker on: push: - branches: [ "main" ] + branches: ["main"] # Publish semver tags as releases. - tags: [ 'v*.*.*' ] + tags: ["v*.*.*"] env: # Use docker.io for Docker Hub if empty @@ -17,10 +17,8 @@ env: # github.repository as / IMAGE_NAME: ${{ github.repository }}/backend - jobs: build: - runs-on: ubuntu-latest permissions: contents: read @@ -38,7 +36,7 @@ jobs: - name: Install cosign uses: sigstore/cosign-installer@59acb6260d9c0ba8f4a2f9d9b48431a222b68e20 #v3.5.0 with: - cosign-release: 'v2.2.4' + cosign-release: "v2.2.4" # Set up BuildKit Docker container builder to be able to build # multi-platform images and export cache diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..c208c2d --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,36 @@ +name: build and release extension +on: + push: + +jobs: + build: + runs-on: ubuntu-22.04 + strategy: + matrix: + node-version: [20] + steps: + - uses: actions/checkout@v4 + - name: Install pnpm + uses: pnpm/action-setup@v4 + with: + version: 9 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + cache: "pnpm" + cache-dependency-path: "**/pnpm-lock.json" + - name: Install dependencies + working-directory: ./chromium/socratic-code + run: pnpm install + - name: Build + working-directory: ./chromium/socratic-code + run: pnpm build + - name: Zip folder + working-directory: ./chromium/socratic-code + run: zip -r socratic-code.zip build + - name: Release + uses: softprops/action-gh-release@v2 + if: startsWith(github.ref, 'refs/tags/') + with: + files: ./socratic-code/chromium/socratic-code.zip diff --git a/chromium/socratic-code/static/manifest.json b/chromium/socratic-code/static/manifest.json index 95c3ff9..410ab51 100644 --- a/chromium/socratic-code/static/manifest.json +++ b/chromium/socratic-code/static/manifest.json @@ -2,7 +2,7 @@ "manifest_version": 3, "name": "Socratic Code", "description": "A browser extension made with Svelte Kit", - "version": "0.0.1", + "version": "0.1.0", "icons": { "32": "socrates_32.png", "64": "socrates_64.png",