From c6ea98333e5a6f4363139510f452cb1641db7aaa Mon Sep 17 00:00:00 2001 From: MengYX Date: Mon, 8 Feb 2021 01:47:31 +0800 Subject: [PATCH] Update CI: Add Extension Build --- .github/workflows/build.yml | 17 ++++++++++++++++- .github/workflows/release.yml | 12 ++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 748cdb2..8e4291c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -27,9 +27,11 @@ jobs: build: [ legacy, modern ] include: - build: legacy - BUILD_ARGS: + BUILD_ARGS: "" + BUILD_EXTENSION: true - build: modern BUILD_ARGS: "-- --modern" + BUILD_EXTENSION: false steps: - uses: actions/checkout@v2 @@ -59,8 +61,21 @@ jobs: npm run build ${{ matrix.BUILD_ARGS }} tar -czvf dist.tar.gz -C ./dist . + - name: Build Extension + if: ${{ matrix.BUILD_EXTENSION }} + run: | + npm run make-extension + zip -rJ9 extension.zip ./dist + - name: Publish artifact uses: actions/upload-artifact@v2 with: name: unlock-music-${{ matrix.build }}.tar.gz path: ./dist.tar.gz + + - name: Publish artifact - Extension + if: ${{ matrix.BUILD_EXTENSION }} + uses: actions/upload-artifact@v2 + with: + name: extension.zip + path: ./extension.zip diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d1e4370..3a1645a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -37,6 +37,8 @@ jobs: npm run build tar -czf legacy.tar.gz -C ./dist . zip -rJ9 legacy.zip ./dist + npm run make-extension + zip -rJ9 extension.zip ./dist - name: Build Modern env: @@ -109,6 +111,16 @@ jobs: asset_name: modern.zip asset_content_type: application/zip + - name: Upload Release Assets - extension.zip + uses: actions/upload-release-asset@v1.0.2 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./extension.zip + asset_name: extension.zip + asset_content_type: application/zip + - name: Upload Release Assets - sha256sum.txt uses: actions/upload-release-asset@v1.0.2 env: