Skip to content

Fix: 웹과 익스텐션의 토큰 관련 이슈를 해결한다 #13

Fix: 웹과 익스텐션의 토큰 관련 이슈를 해결한다

Fix: 웹과 익스텐션의 토큰 관련 이슈를 해결한다 #13

name: CICD Extension
on:
push:
branches:
- master
- develop
pull_request:
branches:
- master
- develop
permissions:
contents: write
jobs:
build-extension:
runs-on: ubuntu-22.04
env:
WEB_URL: "${{ github.ref == 'refs/heads/develop' && secrets.STAGING_WEB_URL || secrets.PROD_WEB_URL }}"
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: pnpm
- name: pnpm install
run: pnpm install --frozen-lockfile --prefer-offline
- name: setting environment variables
run: |
echo "${{ secrets.SHARED_ENV_FILE }}" >> packages/shared/.env
echo WEB_URL=${{ env.WEB_URL }} >> packages/shared/.env
- name: build
run: pnpm run build:extension
- name: Zip the build files
run: pnpm run zip
- name: Upload Extension
uses: actions/upload-artifact@v4
with:
name: extension
path: dist-zip/extension.zip
upload-extension:
needs: build-extension
runs-on: ubuntu-22.04
# 수동 배포를 위해 `v.xx` 태그로 익스텐션 배포를 진행한다.
if: ${{ startsWith(github.ref, 'refs/tags/v.')}}
steps:
- name: Download Artifacts
uses: actions/download-artifact@v4
- name: Upload zipped file on chrome store
uses: mnao305/[email protected]
with:
file-path: extension/extension.zip
extension-id: eaiojpmgklfngpjddhoalgcpkepgkclh
client-id: ${{ secrets.CLIENT_ID }}
client-secret: ${{ secrets.CLIENT_SECRET }}
refresh-token: ${{ secrets.REFRESH_TOKEN }}
publish: false
- name: Update gitHub releases
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref_name }}
run: |
gh release create "$tag" \
--repo="$GITHUB_REPOSITORY" \
--title="${GITHUB_REPOSITORY#*/} ${tag#v}" \
--generate-notes