2020-12-08 18:37:09 +01:00
|
|
|
name: GitHub CI
|
2020-12-08 18:05:02 +01:00
|
|
|
|
|
|
|
on:
|
|
|
|
create:
|
2020-12-08 18:37:09 +01:00
|
|
|
branches: master
|
2020-12-08 18:05:02 +01:00
|
|
|
|
2022-08-31 07:26:57 +02:00
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
|
2020-12-10 14:26:03 +01:00
|
|
|
# I used the following project as template to get started:
|
2020-12-09 16:35:02 +01:00
|
|
|
# https://github.com/dessant/search-by-image/blob/master/.github/workflows/ci.yml
|
2020-12-08 18:37:09 +01:00
|
|
|
|
2020-12-08 18:05:02 +01:00
|
|
|
jobs:
|
|
|
|
build:
|
2022-08-31 07:26:57 +02:00
|
|
|
permissions:
|
|
|
|
contents: write # for creating release
|
2020-12-08 18:37:09 +01:00
|
|
|
name: Build packages
|
2020-12-08 18:05:02 +01:00
|
|
|
runs-on: ubuntu-latest
|
2020-12-09 16:35:02 +01:00
|
|
|
if: startsWith(github.ref, 'refs/tags/')
|
2020-12-08 18:05:02 +01:00
|
|
|
steps:
|
2020-12-09 16:35:02 +01:00
|
|
|
- name: Clone repository
|
2022-09-10 20:38:38 +02:00
|
|
|
uses: actions/checkout@v3
|
2020-12-10 14:26:03 +01:00
|
|
|
with:
|
|
|
|
persist-credentials: false
|
2022-09-10 20:43:44 +02:00
|
|
|
ref: ${{ github.head_ref }}
|
2020-12-09 16:47:10 +01:00
|
|
|
- name: Clone uAssets
|
2020-12-09 16:51:34 +01:00
|
|
|
run: |
|
2021-07-29 16:06:49 +02:00
|
|
|
git submodule update --depth 1 --init
|
2020-12-10 14:26:03 +01:00
|
|
|
# https://www.gnu.org/software/bash/manual/html_node/Shell-Parameter-Expansion.html
|
2020-12-09 17:47:09 +01:00
|
|
|
- name: Get release information
|
|
|
|
id: release_info
|
2020-12-09 17:03:12 +01:00
|
|
|
run: |
|
2020-12-09 17:47:09 +01:00
|
|
|
echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
|
2020-12-09 17:32:56 +01:00
|
|
|
- name: Create GitHub release
|
2020-12-09 17:30:09 +01:00
|
|
|
id: create_release
|
|
|
|
uses: actions/create-release@v1
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ github.token }}
|
|
|
|
with:
|
2020-12-09 17:58:46 +01:00
|
|
|
tag_name: ${{ steps.release_info.outputs.VERSION }}
|
|
|
|
release_name: ${{ steps.release_info.outputs.VERSION }}
|
2020-12-09 17:53:18 +01:00
|
|
|
prerelease: true
|
2022-09-07 16:15:36 +02:00
|
|
|
- name: Build MV2 packages
|
2020-12-09 17:47:09 +01:00
|
|
|
run: |
|
|
|
|
tools/make-chromium.sh ${{ steps.release_info.outputs.VERSION }}
|
|
|
|
tools/make-firefox.sh ${{ steps.release_info.outputs.VERSION }}
|
|
|
|
tools/make-thunderbird.sh ${{ steps.release_info.outputs.VERSION }}
|
2021-08-15 16:43:36 +02:00
|
|
|
tools/make-npm.sh ${{ steps.release_info.outputs.VERSION }}
|
2022-09-07 16:15:36 +02:00
|
|
|
- name: Build MV3 packages
|
|
|
|
run: |
|
2022-09-08 16:16:08 +02:00
|
|
|
tools/make-mv3.sh full
|
2022-09-08 18:07:01 +02:00
|
|
|
echo "MV3PACKAGE=$(basename $(ls dist/build/uBlock0_*.mv3.zip))" >> $GITHUB_ENV
|
2022-09-10 20:20:07 +02:00
|
|
|
cp dist/build/uBlock0.mv3/log.txt dist/chromium-mv3/
|
|
|
|
- name: Commit 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
|
2020-12-09 17:23:14 +01:00
|
|
|
- name: Upload Chromium package
|
|
|
|
uses: actions/upload-release-asset@v1
|
2020-12-08 18:37:09 +01:00
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
with:
|
2020-12-09 17:23:14 +01:00
|
|
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
2020-12-09 17:47:09 +01:00
|
|
|
asset_path: dist/build/uBlock0_${{ steps.release_info.outputs.VERSION }}.chromium.zip
|
2020-12-09 18:00:59 +01:00
|
|
|
asset_name: uBlock0_${{ steps.release_info.outputs.VERSION }}.chromium.zip
|
2020-12-09 17:23:14 +01:00
|
|
|
asset_content_type: application/octet-stream
|
|
|
|
- name: Upload Firefox package
|
|
|
|
uses: actions/upload-release-asset@v1
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
with:
|
|
|
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
2020-12-09 17:53:18 +01:00
|
|
|
asset_path: dist/build/uBlock0_${{ steps.release_info.outputs.VERSION }}.firefox.xpi
|
2020-12-09 18:00:59 +01:00
|
|
|
asset_name: uBlock0_${{ steps.release_info.outputs.VERSION }}.firefox.xpi
|
2020-12-09 17:23:14 +01:00
|
|
|
asset_content_type: application/octet-stream
|
|
|
|
- name: Upload Thunderbird package
|
|
|
|
uses: actions/upload-release-asset@v1
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
with:
|
|
|
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
2020-12-09 17:53:18 +01:00
|
|
|
asset_path: dist/build/uBlock0_${{ steps.release_info.outputs.VERSION }}.thunderbird.xpi
|
2020-12-09 18:00:59 +01:00
|
|
|
asset_name: uBlock0_${{ steps.release_info.outputs.VERSION }}.thunderbird.xpi
|
2020-12-09 17:23:14 +01:00
|
|
|
asset_content_type: application/octet-stream
|
2021-07-29 01:43:11 +02:00
|
|
|
- name: Upload NodeJS package
|
|
|
|
uses: actions/upload-release-asset@v1
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
with:
|
|
|
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
2021-08-15 16:43:36 +02:00
|
|
|
asset_path: dist/build/uBlock0_${{ steps.release_info.outputs.VERSION }}.npm.tgz
|
|
|
|
asset_name: uBlock0_${{ steps.release_info.outputs.VERSION }}.npm.tgz
|
2021-07-29 01:43:11 +02:00
|
|
|
asset_content_type: application/octet-stream
|
2022-09-06 19:47:52 +02:00
|
|
|
- name: Upload Chromium MV3 package
|
|
|
|
uses: actions/upload-release-asset@v1
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
with:
|
|
|
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
2022-09-08 18:07:01 +02:00
|
|
|
asset_path: dist/build/${{ env.MV3PACKAGE }}
|
|
|
|
asset_name: ${{ env.MV3PACKAGE }}
|
2022-09-06 19:47:52 +02:00
|
|
|
asset_content_type: application/octet-stream
|