2022-09-19 09:31:04 -06:00
|
|
|
name: uBO Lite release
|
2022-09-19 09:08:34 -06:00
|
|
|
|
|
|
|
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@v3
|
|
|
|
with:
|
|
|
|
persist-credentials: false
|
|
|
|
# https://www.gnu.org/software/bash/manual/html_node/Shell-Parameter-Expansion.html
|
2023-04-07 11:24:57 -06:00
|
|
|
# Chromium
|
|
|
|
- name: Build Chromium uBOLite MV3 packages
|
2022-09-19 09:08:34 -06:00
|
|
|
run: |
|
2023-04-07 11:24:57 -06:00
|
|
|
tools/make-mv3.sh chromium full
|
|
|
|
echo "PACKAGE=$(basename $(ls dist/build/uBOLite_*.chromium.mv3.zip))" >> $GITHUB_ENV
|
|
|
|
echo "TAGNAME=$(basename $(ls dist/build/uBOLite_*.chromium.mv3.zip) .chromium.mv3.zip)" >> $GITHUB_ENV
|
2022-09-20 07:24:43 -06:00
|
|
|
RELEASENAME=${TAGNAME/_/ }
|
|
|
|
echo "RELEASENAME=$RELEASENAME" >> $GITHUB_ENV
|
2023-08-12 05:50:06 -06:00
|
|
|
cp dist/build/mv3-data/log.txt dist/mv3/
|
2022-09-19 09:31:04 -06:00
|
|
|
- name: Commit uBOLite MV3 build log file
|
|
|
|
# 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: Update build log file
|
2022-09-19 09:08:34 -06:00
|
|
|
- name: Create GitHub release
|
|
|
|
id: create_release
|
2022-12-16 10:17:15 -07:00
|
|
|
uses: ncipollo/release-action@v1
|
2022-09-19 09:08:34 -06:00
|
|
|
with:
|
2022-12-16 10:17:15 -07:00
|
|
|
tag: ${{ env.TAGNAME }}
|
2023-08-19 05:52:44 -06:00
|
|
|
owner: uBlockOrigin
|
2022-09-19 09:08:34 -06:00
|
|
|
prerelease: true
|
2023-08-19 09:26:33 -06:00
|
|
|
repo: uBOL-home
|
2023-08-19 09:09:04 -06:00
|
|
|
token: ${{ secrets.PAT }}
|
2023-04-07 11:24:57 -06:00
|
|
|
- name: Upload Chromium uBOLite MV3 package
|
|
|
|
uses: actions/upload-release-asset@v1
|
|
|
|
env:
|
2023-08-19 08:46:09 -06:00
|
|
|
GITHUB_TOKEN: ${{ secrets.PAT }}
|
2023-04-07 11:24:57 -06:00
|
|
|
with:
|
|
|
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
|
|
|
asset_path: dist/build/${{ env.PACKAGE }}
|
|
|
|
asset_name: ${{ env.PACKAGE }}
|
|
|
|
asset_content_type: application/octet-stream
|
|
|
|
# Firefox
|
|
|
|
- name: Build Firefox uBOLite MV3 packages
|
|
|
|
run: |
|
|
|
|
tools/make-mv3.sh firefox full
|
2023-04-07 11:34:27 -06:00
|
|
|
echo "PACKAGE=$(basename $(ls dist/build/uBOLite_*.firefox.mv3.xpi))" >> $GITHUB_ENV
|
2023-04-07 11:24:57 -06:00
|
|
|
- name: Upload Firefox uBOLite MV3 package
|
2022-09-19 09:08:34 -06:00
|
|
|
uses: actions/upload-release-asset@v1
|
|
|
|
env:
|
2023-08-19 08:46:09 -06:00
|
|
|
GITHUB_TOKEN: ${{ secrets.PAT }}
|
2022-09-19 09:08:34 -06:00
|
|
|
with:
|
|
|
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
|
|
|
asset_path: dist/build/${{ env.PACKAGE }}
|
|
|
|
asset_name: ${{ env.PACKAGE }}
|
|
|
|
asset_content_type: application/octet-stream
|