From cd9cd76549f8514901fcadd56ce3609dac49c0e0 Mon Sep 17 00:00:00 2001 From: Guus van der Meer Date: Mon, 26 Sep 2022 00:02:57 +0200 Subject: [PATCH] Updated the build action (#41) * Changed main release action to listed. * Added unlisted release GitHub action * Updated the artifact zips for all actions --- .github/workflows/build.yml | 11 ++-- .github/workflows/release.yml | 11 +++- .github/workflows/release_unlisted.yml | 86 ++++++++++++++++++++++++++ 3 files changed, 100 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/release_unlisted.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ed4c5e14..a9ec0cbc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,14 +13,10 @@ jobs: run: | cp src/manifest_v3.json src/manifest.json - - name: Archive Release - run: | - 7z a 'IDCAC-chrome.zip' -r './src/*' - - uses: actions/upload-artifact@v3 with: name: IDCAC-chrome - path: 'IDCAC-chrome.zip' + path: ./src/* - name: Move to manifest v2 run: | @@ -35,6 +31,11 @@ jobs: source: src filename: "IDCAC.xpi" + - uses: actions/upload-artifact@v3 + with: + name: IDCAC-firefox-source + path: ./src/* + - uses: actions/upload-artifact@v3 with: name: IDCAC-firefox-unsigned diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 006c0493..b0f45b74 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,4 +1,4 @@ -name: Release extension +name: Release listed on: workflow_dispatch: @@ -25,7 +25,7 @@ jobs: - uses: actions/upload-artifact@v3 with: name: IDCAC-chrome - path: 'IDCAC-chrome.zip' + path: ./src/* - name: Move to manifest v2 run: | @@ -45,13 +45,18 @@ jobs: name: IDCAC-firefox-unsigned path: ${{ steps.web-ext-build.outputs.target }} + - uses: actions/upload-artifact@v3 + with: + name: IDCAC-firefox-source + path: ./src/* + - name: "web-ext sign" id: web-ext-sign uses: kewisch/action-web-ext@v1 with: cmd: sign source: ${{ steps.web-ext-build.outputs.target }} - channel: unlisted + channel: listed apiKey: ${{ secrets.AMO_SIGN_KEY }} apiSecret: ${{ secrets.AMO_SIGN_SECRET }} timeout: 900000 diff --git a/.github/workflows/release_unlisted.yml b/.github/workflows/release_unlisted.yml new file mode 100644 index 00000000..ff85bf27 --- /dev/null +++ b/.github/workflows/release_unlisted.yml @@ -0,0 +1,86 @@ +name: Release unlisted + +on: + workflow_dispatch: + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Generate release tag + id: tag + run: | + echo "::set-output name=release_tag::IDAC_$(date +"%Y.%m.%d_%H-%M")" + + - name: Move to manifest v3 + run: | + cp src/manifest_v3.json src/manifest.json + + - name: Archive Release + run: | + 7z a 'IDCAC-chrome.zip' -r './src/*' + + - uses: actions/upload-artifact@v3 + with: + name: IDCAC-chrome + path: ./src/* + + - name: Move to manifest v2 + run: | + rm src/manifest.json + cp src/manifest_v2.json src/manifest.json + + - name: "web-ext build" + id: web-ext-build + uses: kewisch/action-web-ext@v1 + with: + cmd: build + source: src + filename: "IDCAC.xpi" + + - uses: actions/upload-artifact@v3 + with: + name: IDCAC-firefox-unsigned + path: ${{ steps.web-ext-build.outputs.target }} + + - uses: actions/upload-artifact@v3 + with: + name: IDCAC-firefox-source + path: ./src/* + + - name: "web-ext sign" + id: web-ext-sign + uses: kewisch/action-web-ext@v1 + with: + cmd: sign + source: ${{ steps.web-ext-build.outputs.target }} + channel: unlisted + apiKey: ${{ secrets.AMO_SIGN_KEY }} + apiSecret: ${{ secrets.AMO_SIGN_SECRET }} + timeout: 900000 + + - uses: actions/upload-artifact@v3 + with: + name: IDCAC-firefox-signed + path: ${{ steps.web-ext-sign.outputs.target }} + + - name: Rename xpi + run: | + mv ${{ steps.web-ext-sign.outputs.target }} IDCAC-firefox.xpi + + - name: "Create Release" + uses: softprops/action-gh-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + draft: true + files: | + IDCAC-chrome.zip + IDCAC-firefox.xpi + + + + +