forked from Tylian/XKit
-
Notifications
You must be signed in to change notification settings - Fork 135
72 lines (61 loc) · 2.71 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
name: Generate Release
on:
workflow_dispatch:
permissions:
contents: write
jobs:
sign-and-release:
name: Sign and Generate Release
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
cache: npm
- run: npm ci
- name: Lint WebExtension
run: npm run lint
- name: Get Release Version
uses: actions/github-script@v7
id: get-version
with:
result-encoding: string
script: |
const fs = require('node:fs');
const { version } = JSON.parse(fs.readFileSync(('${{ github.workspace }}/manifest.json')));
const releases = await github.paginate(github.rest.repos.listReleases, { owner: context.repo.owner, repo: context.repo.repo, });
if (releases.some(({ tag_name }) => tag_name === `v${version}`)) {
throw new Error(`Release v${version} already exists! Did you forget to bump the manifest.json version?`);
}
return version;
- name: Firefox — Build and Sign
run: npm run sign
timeout-minutes: 30
env:
WEB_EXT_API_KEY: ${{ secrets.WEB_EXT_API_KEY }}
WEB_EXT_API_SECRET: ${{ secrets.WEB_EXT_API_SECRET }}
WEB_EXT_CHANNEL: unlisted
### NOTE: This workflow may time out here while waiting for Mozilla review.
### If this occurs, run the "Generate Release (after signing)" action once it is complete.
# - name: Chrome — Build
# run: npm run build
# - name: Chrome — Upload and Publish
# run: npx chrome-webstore-upload --source=web-ext-artifacts/new_xkit-${{ steps.get-version.outputs.result }}.zip
# env:
# EXTENSION_ID: ${{ secrets.CHROME_EXTENSION_ID }}
# CLIENT_ID: ${{ secrets.CHROME_CLIENT_ID }}
# CLIENT_SECRET: ${{ secrets.CHROME_CLIENT_SECRET }}
# REFRESH_TOKEN: ${{ secrets.CHROME_REFRESH_TOKEN }}
- name: Create Github release draft
uses: softprops/action-gh-release@v2
with:
name: New XKit ${{ steps.get-version.outputs.result }}
tag_name: v${{ steps.get-version.outputs.result }}
body: |
<!-- -->
**NOTE:** Firefox may complain about getting a connection error when clicking the below XPI link. If it does, right-click the link and select "Save Link As...", then navigate to `about:addons` and drag the file onto that screen to install New XKit.
For Chrome: Install from the [Chrome Web Store](https://new-xkit-extension.tumblr.com/chrome) instead of here.
files: web-ext-artifacts/*.xpi
draft: true