Skip to content

Commit

Permalink
feat: github action to zip extension and upload to release assets
Browse files Browse the repository at this point in the history
  • Loading branch information
LarchLiu committed Jun 1, 2023
1 parent 02ca24f commit 8c93201
Showing 1 changed file with 25 additions and 10 deletions.
35 changes: 25 additions & 10 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ jobs:

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- uses: pnpm/action-setup@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
Expand All @@ -36,17 +39,29 @@ jobs:
publish_dir: ./app/bot/telegram-cl/dist, ./app/extension/chrome/dist
full_commit_message: ${{ github.event.head_commit.message }}

release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- uses: actions/setup-node@v3
- name: Zip extension
uses: vimtor/action-zip@v1.1
with:
node-version: 18.x
files: ./app/extension/chrome/dist
recursive: false
dest: ./chrome-extension.zip

- run: npx changelogithub # or changelogithub@0.12 if ensure the stable result
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Get latest release id
id: get-release-id
run: echo "release_id=$(curl -s https://api.github.com/repos/${{ github.repository }}/releases/latest | jq '.id' | sed 's/\"//g')" >> $GITHUB_OUTPUT

- name: Upload Release Asset
id: upload-release-asset
uses: LarchLiu/upload-release-assets@v1.2.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
repository: ${{ github.repository }}
release_id: ${{ steps.get-release-id.outputs.release_id }}
asset_path: ./chrome-extension.zip
asset_name: chrome-extension.zip
asset_content_type: application/zip

1 comment on commit 8c93201

@vercel
Copy link

@vercel vercel bot commented on 8c93201 Jun 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

star-nexus – ./

star-nexus-larchliu.vercel.app
star-nexus-git-main-larchliu.vercel.app
star-nexus.vercel.app

Please sign in to comment.