-
Notifications
You must be signed in to change notification settings - Fork 54
81 lines (75 loc) · 3.05 KB
/
create_beta.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
73
74
75
76
77
78
79
80
81
name: uBO Lite beta
on: workflow_dispatch
permissions:
contents: read
jobs:
build:
permissions:
contents: write # for creating release
name: Build packages
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@v4
with:
persist-credentials: false
# Set uBO version to use
- name: uBO version to use
run: |
UBO_VERSION_URL=$(cat ubo-version)
UBO_VERSION=${UBO_VERSION_URL: -40}
echo "UBO_VERSION=$UBO_VERSION" >> $GITHUB_ENV
# https://www.gnu.org/software/bash/manual/html_node/Shell-Parameter-Expansion.html
- name: Clone uBO repo
run: |
UBLOCK_REPO_DIR=$(mktemp -d)
echo "UBLOCK_REPO_DIR=$UBLOCK_REPO_DIR" >> $GITHUB_ENV
git clone --depth 1 https://github.com/gorhill/uBlock.git $UBLOCK_REPO_DIR
# Version, time-based
- name: Create unique time-based version
run: |
TAGNAME=uBOLite_$(date -u "+%Y.%-m.%-d.")$(date -u "+%H*60+%M" | bc)
echo "TAGNAME=$TAGNAME" >> $GITHUB_ENV
echo "Version: $TAGNAME"
# Chromium
- name: Build Chromium uBOLite beta
run: |
UBOL_REPO_DIR=$(pwd)
cd $UBLOCK_REPO_DIR
tools/make-mv3.sh chromium ${{ env.TAGNAME }} before=$UBOL_REPO_DIR
cd - > /dev/null
mv ${{ env.UBLOCK_REPO_DIR }}/dist/build/${{ env.TAGNAME }}.chromium.mv3.zip \
${{ env.UBLOCK_REPO_DIR }}/dist/build/uBOLite.beta.chromium.zip
# Firefox
- name: Build Firefox uBOLite MV3 packages
run: |
UBOL_REPO_DIR=$(pwd)
cd $UBLOCK_REPO_DIR
tools/make-mv3.sh firefox ${{ env.TAGNAME }} before=$UBOL_REPO_DIR
cd - > /dev/null
mv ${{ env.UBLOCK_REPO_DIR }}/dist/build/${{ env.TAGNAME }}.firefox.mv3.xpi \
${{ env.UBLOCK_REPO_DIR }}/dist/build/uBOLite.beta.firefox.xpi
- name: Create GitHub beta release
id: create_beta_release
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.TAGNAME }}-beta
name: ${{ env.TAGNAME }}-beta
prerelease: true
body: |
**uBO Lite** (uBOL), a **permission-less** [MV3 API-based](https://developer.chrome.com/docs/extensions/mv3/intro/) content blocker.
- [Synopsis](https://github.com/uBlockOrigin/uBOL-issues#readme)
- [Documentation](https://github.com/uBlockOrigin/uBOL-home/wiki)
**This is a beta version.**
Based on <https://github.com/gorhill/uBlock/tree/${{ env.UBO_VERSION }}>
- name: Upload Chromium uBOLite beta
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.TAGNAME }}-beta
files: |
${{ env.UBLOCK_REPO_DIR }}/dist/build/uBOLite.beta.chromium.zip
${{ env.UBLOCK_REPO_DIR }}/dist/build/uBOLite.beta.firefox.xpi