From 12d763f24728fa0fa9aea831642964c2bbe16c67 Mon Sep 17 00:00:00 2001 From: Hugo COLLIN Date: Mon, 2 Sep 2024 01:46:09 +0200 Subject: [PATCH 1/2] ci: fix package name, getting from package.json --- .github/workflows/publish.yml | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 42bd6962..8f7f43f2 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -18,9 +18,11 @@ jobs: with: node-version: '18' - - name: Get version from package.json - id: package_version - run: echo "::set-output name=version::$(node -p "require('./package.json').version")" + - name: Get package info + id: package_info + run: | + echo "::set-output name=version::$(node -p "require('./package.json').version")" + echo "::set-output name=name::$(node -p "require('./package.json').name")" # --- BUILD --- - name: Install dependencies @@ -29,17 +31,17 @@ jobs: - name: Build extension run: npm run prod - - name: Prepare source code zip - run: zip -r releases/save-my-phind_${{ github.run_number }}_firefox_source.zip src/ +# - name: Prepare source code zip +# run: zip -r releases/${{ steps.package_info.outputs.name }}_${{ github.run_number }}_firefox_source.zip src/ # --- TAG --- - name: Create Tag - run: git tag v${{ steps.package_version.outputs.version }} + run: git tag v${{ steps.package_info.outputs.version }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Push Tag - run: git push origin v${{ steps.package_version.outputs.version }} + run: git push origin v${{ steps.package_info.outputs.version }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -68,8 +70,8 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - tag_name: v${{ steps.package_version.outputs.version }} - release_name: ⏩ v${{ steps.package_version.outputs.version }} + tag_name: v${{ steps.package_info.outputs.version }} + release_name: ⏩ v${{ steps.package_info.outputs.version }} body: ${{ steps.github_release.outputs.changelog }} draft: false prerelease: false @@ -80,8 +82,8 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ./releases/save-my-phind_${{ steps.package_version.outputs.version }}_chrome.zip - asset_name: save-my-phind_${{ steps.package_version.outputs.version }}_chrome.zip + asset_path: ./releases/${{ steps.package_info.outputs.name }}_${{ steps.package_info.outputs.version }}_chrome.zip + asset_name: ${{ steps.package_info.outputs.name }}_${{ steps.package_info.outputs.version }}_chrome.zip asset_content_type: application/zip - name: Upload Release Asset Firefox @@ -90,8 +92,8 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ./releases/save-my-phind_${{ steps.package_version.outputs.version }}_firefox.zip - asset_name: save-my-phind_${{ steps.package_version.outputs.version }}_firefox.zip + asset_path: ./releases/${{ steps.package_info.outputs.name }}_${{ steps.package_info.outputs.version }}_firefox.zip + asset_name: ${{ steps.package_info.outputs.name }}_${{ steps.package_info.outputs.version }}_firefox.zip asset_content_type: application/zip # - name: Download CRX and XPI files @@ -125,7 +127,7 @@ jobs: env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - title: "🥳 Hey, it's an update: Save My Chatbot v${{ steps.package_version.outputs.version }}" + title: "🤖 Hey, it's an update: Save My Chatbot v${{ steps.package_info.outputs.version }}" body: ${{ steps.github_release.outputs.changelog }} repository-id: ${{ secrets.repository_id }} category-id: ${{ secrets.category_id }} From 6f0e3e253f9e884620d0589fd3f8f7ab73263d5b Mon Sep 17 00:00:00 2001 From: Hugo COLLIN Date: Mon, 2 Sep 2024 02:10:11 +0200 Subject: [PATCH 2/2] ci: specify new zip location for BPP due to package name changing --- .github/workflows/publish.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 8f7f43f2..f502a131 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -137,3 +137,6 @@ jobs: uses: PlasmoHQ/bpp@v3.6.1 with: keys: ${{ secrets.BPP_KEYS }} + chrome-file: releases/${{ steps.package_info.outputs.name }}_${{ steps.package_info.outputs.version }}_chrome.zip + firefox-file: releases/${{ steps.package_info.outputs.name }}_${{ steps.package_info.outputs.version }}_firefox.zip + edge-file: releases/${{ steps.package_info.outputs.name }}_${{ steps.package_info.outputs.version }}_chrome.zip