forked from M-rcus/OnlyFans-Cookie-Helper
-
Notifications
You must be signed in to change notification settings - Fork 0
86 lines (72 loc) · 3.02 KB
/
release.yaml
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
name: Release
on:
push:
tags:
- 'v*.*.*'
jobs:
release:
runs-on: [self-hosted, ubuntu-latest]
steps:
- uses: actions/checkout@v2
- name: Get Firefox extension version
uses: sergeysova/jq-action@v2
id: firefox_version
with:
cmd: 'jq -r .version firefox_manifest.json'
- name: Get Chrome extension version
uses: sergeysova/jq-action@v2
id: chrome_version
with:
cmd: 'jq -r .version chrome_manifest.json'
- name: Check extension versions
run: |
if [ "${{ steps.firefox_version.outputs.value }}" != "${{ steps.chrome_version.outputs.value }}" ]; then
echo "Extension versions do not match (${{ steps.firefox_version.outputs.value }} != ${{ steps.chrome_version.outputs.value }})"
exit 1
fi
if [ "refs/tags/v${{ steps.firefox_version.outputs.value }}" != "${{ github.ref }}" ]; then
echo "Tag (${{ github.ref }}) does not match extension version (${{ steps.firefox_version.outputs.value }})"
exit 1
fi
- name: Prepare for Firefox build
run: |
bash bin/prepare_build.sh firefox
mkdir -p dist
- name: Add Firefox extension id to manifest
uses: sergeysova/jq-action@v2
with:
cmd: 'echo $(jq ". += {\"browser_specific_settings\": {\"gecko\": {\"id\": \"${{ vars.FIREFOX_EXTENSION_ID }}\"}}}" build/manifest.json) > build/manifest.json'
- name: Firefox build
uses: kewisch/action-web-ext@v1
id: firefox_build
with:
cmd: build
source: build
artifactsDir: dist
- name: Rename Firefox extension
run: mv ${{ steps.firefox_build.outputs.target }} dist/OF-DL_Auth_Helper-firefox-${{ steps.firefox_version.outputs.value }}.zip
- name: Prepare for Chrome build
run: |
bash bin/prepare_build.sh chrome
- name: Chrome pack extension
uses: cardinalby/webext-buildtools-pack-extension-dir-action@v1
with:
extensionDir: build
zipFilePath: dist/OF-DL_Auth_Helper-chrome-${{ steps.chrome_version.outputs.value }}.zip
- name: Create Chrome CRX
uses: cardinalby/webext-buildtools-chrome-crx-action@v2
with:
zipFilePath: dist/OF-DL_Auth_Helper-chrome-${{ steps.chrome_version.outputs.value }}.zip
crxFilePath: dist/OF-DL_Auth_Helper-chrome-${{ steps.chrome_version.outputs.value }}.crx
privateKey: ${{ secrets.CHROME_PRIVATE_KEY }}
- name: Upload artifacts
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
draft: true
fail_on_unmatched_files: true
files: |
dist/OF-DL_Auth_Helper-firefox-${{ steps.firefox_version.outputs.value }}.zip
dist/OF-DL_Auth_Helper-chrome-${{ steps.chrome_version.outputs.value }}.crx
dist/OF-DL_Auth_Helper-chrome-${{ steps.chrome_version.outputs.value }}.zip