fix:can not get the target jobitem #15
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
on: | |
push: | |
tags: | |
- '*' | |
workflow_dispatch: | |
permissions: | |
contents: write | |
jobs: | |
build-and-release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Setup pnpm | |
uses: pnpm/action-setup@v2 | |
with: | |
version: 9.9.0 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
cache: 'pnpm' | |
- name: Install dependencies | |
run: pnpm install | |
- name: Build and zip extensions | |
run: | | |
pnpm zip # 生成 Chrome ZIP | |
pnpm zip:firefox # 生成 Firefox ZIP | |
echo '------------------------output------------------------' | |
ls .output # 列出 .output 目录,以确认文件生成情况 | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref_name }} # 使用标签名称 | |
release_name: 'Findjob-bot ${{ github.ref_name }}' # 统一使用标签名称 | |
draft: false | |
prerelease: false | |
- name: Upload Chrome Release Asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: .output/findjob-bot-${{ github.ref_name }}-chrome.zip # 根据标签动态生成文件名 | |
asset_name: findjob-bot-${{ github.ref_name }}-chrome.zip | |
asset_content_type: application/zip | |
- name: Upload Firefox Release Asset | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: .output/findjob-bot-${{ github.ref_name }}-firefox.zip # 根据标签动态生成文件名 | |
asset_name: findjob-bot-${{ github.ref_name }}-firefox.zip | |
asset_content_type: application/zip |