Skip to content

Commit

Permalink
ci(chrome_extension): add release workflow
Browse files Browse the repository at this point in the history
Signed-off-by: Aryan Goyal <[email protected]>
  • Loading branch information
ary82 committed Oct 2, 2024
1 parent a567579 commit 5ab4549
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 9 deletions.
8 changes: 3 additions & 5 deletions .github/workflows/backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,18 @@ 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
REGISTRY: ghcr.io
# github.repository as <account>/<repo>
IMAGE_NAME: ${{ github.repository }}/backend


jobs:
build:

runs-on: ubuntu-latest
permissions:
contents: read
Expand All @@ -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
Expand Down
40 changes: 40 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
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: "chromium/socratic-code/pnpm-lock.yaml"
- 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
with:
token: ${{ secrets.GH_OWNER_TOKEN }}
tags: v1.0.0
prerelease: false
draft: false
generate_release_notes: false
files: ./socratic-code/chromium/socratic-code.zip
1 change: 0 additions & 1 deletion chromium/socratic-code/.env.example

This file was deleted.

2 changes: 1 addition & 1 deletion chromium/socratic-code/src/lib/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
// place files you want to import through the `$lib` alias in this folder.
export const PUBLIC_BACKEND_URL = 'https://socratic-leetcode-875479114962.asia-south1.run.app';
2 changes: 1 addition & 1 deletion chromium/socratic-code/src/routes/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script lang="ts">
import { PUBLIC_BACKEND_URL } from '$lib';
import { onMount } from 'svelte';
import { PUBLIC_BACKEND_URL } from '$env/static/public';
let content: string = '';
Expand Down
2 changes: 1 addition & 1 deletion chromium/socratic-code/static/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 5ab4549

Please sign in to comment.