name: uBO release on: workflow_dispatch: create: branches: master permissions: contents: read jobs: build: permissions: contents: write # for creating release name: Build packages runs-on: ubuntu-latest if: startsWith(github.ref, 'refs/tags/') steps: - name: Checkout repository uses: actions/checkout@v4 with: persist-credentials: false - name: Checkout uAssets repository run: | tools/pull-assets.sh - name: Get release information id: release_info run: | echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV - name: Assemble release notes run: | > release.body.txt grep -m1 -B10000 -- "----------" CHANGELOG.md >> release.body.txt sed -e 's/%version%/'"$VERSION"'/g' RELEASE.HEAD.md >> release.body.txt - name: Build MV2 packages run: | tools/make-chromium.sh $VERSION tools/make-firefox.sh $VERSION tools/make-thunderbird.sh $VERSION tools/make-npm.sh $VERSION - name: Create GitHub release id: create_release uses: softprops/action-gh-release@v2 with: tag_name: ${{ env.VERSION }} release_name: ${{ env.VERSION }} draft: true prerelease: true body_path: release.body.txt env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Upload Chromium package uses: softprops/action-gh-release@v2 with: upload_url: ${{ steps.create_release.outputs.upload_url }} asset_path: dist/build/uBlock0_${{ env.VERSION }}.chromium.zip asset_name: uBlock0_${{ env.VERSION }}.chromium.zip asset_content_type: application/octet-stream env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Upload Firefox package uses: softprops/action-gh-release@v2 with: upload_url: ${{ steps.create_release.outputs.upload_url }} asset_path: dist/build/uBlock0_${{ env.VERSION }}.firefox.xpi asset_name: uBlock0_${{ env.VERSION }}.firefox.xpi asset_content_type: application/octet-stream env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Upload Thunderbird package uses: softprops/action-gh-release@v2 with: upload_url: ${{ steps.create_release.outputs.upload_url }} asset_path: dist/build/uBlock0_${{ env.VERSION }}.thunderbird.xpi asset_name: uBlock0_${{ env.VERSION }}.thunderbird.xpi asset_content_type: application/octet-stream env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Upload NodeJS package uses: softprops/action-gh-release@v2 with: upload_url: ${{ steps.create_release.outputs.upload_url }} asset_path: dist/build/uBlock0_${{ env.VERSION }}.npm.tgz asset_name: uBlock0_${{ env.VERSION }}.npm.tgz asset_content_type: application/octet-stream env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}