-
Notifications
You must be signed in to change notification settings - Fork 185
89 lines (86 loc) · 3.28 KB
/
Copy pathcreate_beta.yml
File metadata and controls
89 lines (86 loc) · 3.28 KB
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
name: uBO Lite beta
on: workflow_dispatch
permissions:
contents: read
jobs:
build:
permissions:
contents: write # for creating release
name: Build packages
runs-on: ubuntu-slim
steps:
- name: Clone repository
uses: actions/checkout@v5
with:
persist-credentials: false
submodules: recursive
- name: Locate uBO repo
run: |
UBOL_REPO_DIR=$(pwd)
UBLOCK_REPO_DIR="$UBOL_REPO_DIR/uBlock"
echo "UBLOCK_REPO_DIR=$UBLOCK_REPO_DIR" >> $GITHUB_ENV
# Version, time-based
- name: Create unique time-based version
run: |
TAGNAME=$(date -u "+%Y").$(date -u "+%-m*100+%-d" | bc).$(date -u "+%H*100+%M" | bc)
echo "TAGNAME=$TAGNAME" >> $GITHUB_ENV
echo "Version: $TAGNAME"
# Chromium
- name: Build Chromium uBOLite beta
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
UBOL_REPO_DIR=$(pwd)
cd $UBLOCK_REPO_DIR
tools/make-mv3.sh chromium ${{ env.TAGNAME }}
cd - > /dev/null
mv ${{ env.UBLOCK_REPO_DIR }}/dist/build/uBOLite_${{ env.TAGNAME }}.chromium.zip \
${{ env.UBLOCK_REPO_DIR }}/dist/build/uBOLite.beta.chromium.zip
# Edge
- name: Build Edge uBOLite beta
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
UBOL_REPO_DIR=$(pwd)
cd $UBLOCK_REPO_DIR
tools/make-mv3.sh edge ${{ env.TAGNAME }}
cd - > /dev/null
mv ${{ env.UBLOCK_REPO_DIR }}/dist/build/uBOLite_${{ env.TAGNAME }}.edge.zip \
${{ env.UBLOCK_REPO_DIR }}/dist/build/uBOLite.beta.edge.zip
# Firefox
- name: Build Firefox uBOLite beta
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
UBOL_REPO_DIR=$(pwd)
cd $UBLOCK_REPO_DIR
tools/make-mv3.sh firefox ${{ env.TAGNAME }}
cd - > /dev/null
mv ${{ env.UBLOCK_REPO_DIR }}/dist/build/uBOLite_${{ env.TAGNAME }}.firefox.xpi \
${{ env.UBLOCK_REPO_DIR }}/dist/build/uBOLite.beta.firefox.xpi
# Safari
- name: Build Safari uBOLite beta
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
UBOL_REPO_DIR=$(pwd)
cd $UBLOCK_REPO_DIR
tools/make-mv3.sh safari ${{ env.TAGNAME }}
cd - > /dev/null
mv ${{ env.UBLOCK_REPO_DIR }}/dist/build/uBOLite_${{ env.TAGNAME }}.safari.zip \
${{ env.UBLOCK_REPO_DIR }}/dist/build/uBOLite.beta.safari.zip
- name: Create GitHub beta release
id: create_beta_release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
sed -e 's/%tag%/${{ env.TAGNAME }}-beta/g' .github/workflows/BETA_BODY.md > beta_body.txt
gh release create ${{ env.TAGNAME }}-beta \
--title "${{ env.TAGNAME }}-beta" \
--prerelease \
--notes-file beta_body.txt
gh release upload ${{ env.TAGNAME }}-beta \
${{ env.UBLOCK_REPO_DIR }}/dist/build/uBOLite.beta.chromium.zip \
${{ env.UBLOCK_REPO_DIR }}/dist/build/uBOLite.beta.edge.zip \
${{ env.UBLOCK_REPO_DIR }}/dist/build/uBOLite.beta.firefox.xpi \
${{ env.UBLOCK_REPO_DIR }}/dist/build/uBOLite.beta.safari.zip