Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
7gugu committed Aug 31, 2024
2 parents ea6134d + c6838ae commit 5f139cd
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 6 deletions.
64 changes: 64 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Build and Publish

on:
push:
branches: [ main ]
workflow_dispatch:

env:
MAJOR_VER: 1
MINOR_VER: 1

jobs:
build_firefox:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: '21.6.2'
- run: npm install --legacy-peer-deps
- run: npm run build -- --env=version=$MAJOR_VER.$MINOR_VER.${{ github.run_number }}
- name: Zip firefox
run: zip -qq -r firefox.zip *
working-directory: dist
- uses: actions/upload-artifact@v4
with:
name: firefox
path: dist/firefox.zip

publish_firefox:
needs: [build_firefox]
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'
steps:
- uses: actions/checkout@v4
- name: Zip source
run: zip -qq -r src.zip *
- name: Download extension
uses: actions/download-artifact@v4
with:
name: firefox
- name: Publish Firefox
uses: maoserr/firefox_extension_publish@v1.0.4
with:
firefox_extension_id: whistleSwicher@7gugu.com
api_key: ${{ secrets.FIREFOX_API_KEY }}
api_secret: ${{ secrets.FIREFOX_API_SECRET }}
file: firefox.zip
src_file: src.zip

publish_release:
needs: [ build_firefox ]
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'
steps:
- name: Download extension
uses: actions/download-artifact@v4
- name: Release
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ env.MAJOR_VER }}.${{ env.MINOR_VER }}.${{ github.run_number }}
files: |
firefox/firefox.zip
7 changes: 1 addition & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

| 规则管理 | 黑名单设置 | 状态设置 |
| ----- | --------- | ----------- |
| ![规则管理](https://i.v2ex.co/7M0JYeB0l.png) |![黑名单设置](https://i.v2ex.co/9X5gRtgDl.png) | ![状态设置](https://i.v2ex.co/LD372Ec5l.png) |
| ![规则管理](https://i.v2ex.co/7M0JYeB0l.png) |![黑名单设置](https://i.v2ex.co/9X5gRtgDl.png) | ![状态设置](https://i.v2ex.co/LD372Ec5l.png) |

## 下载地址

Expand All @@ -46,11 +46,6 @@
3. 产物将会生成在项目根目录下的dist文件夹中
4. 通过Firefox的 `about:debugging` 安装`dist/manifest.json` 即可安装本地构建的addon

## 数据统计
> 更新时间: 2024年08月05日
<img width="742" alt="图片" src="https://github.com/user-attachments/assets/66a5a2eb-6552-4d3e-ac59-8b610a28c738">

## 联系方式

> 如果有使用问题,可以优先通过邮箱和Firefox评论区提交问题,正常情况下在一个工作日内就会回复。(公共假期不定期回复)
Expand Down

0 comments on commit 5f139cd

Please sign in to comment.