-
Notifications
You must be signed in to change notification settings - Fork 47
130 lines (116 loc) · 5.82 KB
/
create_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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
name: uBO Lite release
on: workflow_dispatch
permissions:
contents: read
# I used the following project as template to get started:
# https://github.com/dessant/search-by-image/blob/master/.github/workflows/ci.yml
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 MV3 packages
run: |
UBOL_REPO_DIR=$(pwd)
cd $UBLOCK_REPO_DIR
tools/make-mv3.sh chromium ${{ env.TAGNAME }} before=$UBOL_REPO_DIR
echo "CHROMIUM_PACKAGE=${{ env.TAGNAME }}.chromium.mv3.zip" >> $GITHUB_ENV
cd - > /dev/null
rm -rf chromium
mv "$UBLOCK_REPO_DIR/dist/build/uBOLite.chromium" chromium
cp "$UBLOCK_REPO_DIR/dist/build/mv3-data/log.txt" chromium/
# 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
echo "FIREFOX_PACKAGE=${{ env.TAGNAME }}.firefox.mv3.xpi" >> $GITHUB_ENV
cd - > /dev/null
rm -rf firefox
mv "$UBLOCK_REPO_DIR/dist/build/uBOLite.firefox" firefox
cp "$UBLOCK_REPO_DIR/dist/build/mv3-data/log.txt" firefox/
# Edge
- name: Build Edge uBOLite MV3 packages
run: |
make edge
pushd build/uBOLite.edge/ > /dev/null
zip ../${{ env.TAGNAME }}.edge.mv3.zip -qr ./*
popd > /dev/null
echo "EDGE_PACKAGE=${{ env.TAGNAME }}.edge.mv3.zip" >> $GITHUB_ENV
- name: Commit uBOLite MV3 package files
# https://github.com/marketplace/actions/github-action-for-committing-changes-to-a-repository
uses: devops-infra/action-commit-push@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
commit_message: "[workflow] Update uBOLite MV3 package files for ${{ env.TAGNAME }}"
- name: Create GitHub release
id: create_release
uses: ncipollo/release-action@v1
with:
tag: ${{ env.TAGNAME }}
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)
## Release notes
- Updated filter lists
- [Commit history](https://github.com/uBlockOrigin/uBOL-home/commits/${{ env.TAGNAME }})
- Based on <https://github.com/gorhill/uBlock/tree/${{ env.UBO_VERSION }}>
---
## Installation
- Chromium-based browsers: Install [from the Chrome Web Store](https://chrome.google.com/webstore/detail/ddkjiahejlhfcafbddmgiahcphecmpfh)
- Firefox: [Install from AMO](https://addons.mozilla.org/firefox/addon/ublock-origin-lite/)
- Microsoft Edge: Install [from the Egde Add-ons store](https://microsoftedge.microsoft.com/addons/detail/ublock-origin-lite/cimighlppcgcoapaliogpjjdehbnofhn)
The extension will auto-update when a new version is published.
<details><summary>Manual installation</summary>
- Chromium: Download the [${{ env.TAGNAME }}.chromium.mv3.zip](https://github.com/uBlockOrigin/uBOL-home/releases/download/${{ env.TAGNAME }}/${{ env.TAGNAME }}.chromium.mv3.zip) package below, unzip, navigate to `chrome://extensions/` in your browser, then [tell the browser to load the extension](https://stackoverflow.com/questions/24577024/install-chrome-extension-form-outside-the-chrome-web-store/24577660#24577660). You will have to update the extension manually.
- Firefox: Click [${{ env.TAGNAME }}.firefox.signed.mv3.xpi](https://github.com/uBlockOrigin/uBOL-home/releases/download/${{ env.TAGNAME }}/${{ env.TAGNAME }}.firefox.signed.mv3.xpi)
</details>
- name: Upload Chromium uBOLite MV3 package
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.TAGNAME }}
files: ${{ env.UBLOCK_REPO_DIR }}/dist/build/${{ env.CHROMIUM_PACKAGE }}
- name: Upload Firefox uBOLite MV3 package
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.TAGNAME }}
files: ${{ env.UBLOCK_REPO_DIR }}/dist/build/${{ env.FIREFOX_PACKAGE }}
- name: Upload Edge uBOLite MV3 package
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.TAGNAME }}
files: build/${{ env.EDGE_PACKAGE }}