Skip to content

Commit

Permalink
ci: upload r2 with version
Browse files Browse the repository at this point in the history
  • Loading branch information
erguotou520 committed Feb 15, 2024
1 parent 23b0f71 commit 038365d
Showing 1 changed file with 19 additions and 16 deletions.
35 changes: 19 additions & 16 deletions .github/workflows/build-chrome-ext.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,27 @@ jobs:

steps:
- uses: actions/checkout@v3
- name: Cache pnpm modules
uses: actions/cache@v3
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-
- uses: pnpm/[email protected]
- uses: oven-sh/setup-bun@v1
- name: Install dependencies
run: bun install
- name: Build the extension
run: bun run build --zip && bun run build --target=edge-mv3 --zip && rm -rf build/chrome-mv3-prod build/edge-mv3-prod
- name: get-npm-version
id: package-version
uses: martinbeentjes/[email protected]
with:
version: latest
run_install: true
- name: Use Node.js 16.x
uses: actions/[email protected]
path: packages/chrome-ext
- name: R2 Upload Action
uses: ryand56/r2-upload-action@latest
with:
node-version: 16.x
cache: "pnpm"
- name: Build the extension
run: pnpm build --zip && pnpm build --target=edge-mv3 --zip && rm -rf build/chrome-mv3-prod build/edge-mv3-prod
r2-account-id: ${{ secrets.R2_ACCOUNT_ID }}
r2-access-key-id: ${{ secrets.R2_ACCESS_KEY_ID }}
r2-secret-access-key: ${{ secrets.R2_SECRET_ACCESS_KEY }}
r2-bucket: ${{ secrets.R2_BUCKET }}
source-dir: packages/chrome-ext/build
destination-dir: ./${{ steps.package-version.outputs.current-version}}/
- name: Create version file
run: echo "${{ steps.package-version.outputs.current-version }}" > build/version.txt
- name: R2 Upload Action
uses: ryand56/r2-upload-action@latest
with:
Expand Down

0 comments on commit 038365d

Please sign in to comment.