diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2a5a2836cdba..22ddf8e876b2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,8 +11,7 @@ on: jobs: Version: outputs: - created: ${{ steps.daily-version.outputs.created }} - version: ${{ steps.daily-version.outputs.version }} + created: ${{ env.DAILY_VERSION_CREATED }} runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -22,21 +21,25 @@ jobs: with: node-version-file: '.nvmrc' cache: npm - - name: install - run: npm ci || npm install - - run: npm test - - uses: fregante/daily-version-action@v1 + - run: npm ci + - name: Test and build + run: npm test + - uses: fregante/daily-version-action@v2 name: Create tag if necessary - id: daily-version - - if: steps.daily-version.outputs.created + - name: Update extension’s meta + run: npx dot-json@1 $DIRECTORY/manifest.json version $DAILY_VERSION + - uses: actions/upload-artifact@v3 + with: + name: built + path: ${{ env.DIRECTORY }} + - if: env.DAILY_VERSION_CREATED name: Create release env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + working-directory: ${{ env.DIRECTORY }} run: | - cd distribution zip -r refined-github-local-install.zip * - gh release create "${{ steps.daily-version.outputs.version }}" --generate-notes refined-github-local-install.zip - + gh release create "$DAILY_VERSION" --generate-notes refined-github-local-install.zip Submit: needs: Version @@ -49,32 +52,18 @@ jobs: - chrome runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - with: - node-version-file: '.nvmrc' - cache: npm - - name: install - run: npm ci || npm install - - run: npm run build --if-present - - name: Update extension’s meta - run: >- - npx dot-json@1 $DIRECTORY/manifest.json version ${{ - needs.Version.outputs.version }} - - name: Submit - run: | - case ${{ matrix.command }} in - chrome) - cd $DIRECTORY && npx chrome-webstore-upload-cli@2 upload --auto-publish - ;; - firefox) - cd $DIRECTORY && npx web-ext-submit@7 - ;; - esac + - uses: actions/download-artifact@v3 + - name: Submit to Mozilla + if: matrix.command === 'firefox' + run: cd artifacts/built && npx web-ext-submit@7 + env: + WEB_EXT_API_KEY: ${{ secrets.WEB_EXT_API_KEY }} + WEB_EXT_API_SECRET: ${{ secrets.WEB_EXT_API_SECRET }} + - name: Submit to Google + if: matrix.command === 'chrome' + run: cd artifacts/built && npx chrome-webstore-upload-cli@2 upload --auto-publish env: EXTENSION_ID: ${{ secrets.EXTENSION_ID }} CLIENT_ID: ${{ secrets.CLIENT_ID }} CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }} REFRESH_TOKEN: ${{ secrets.REFRESH_TOKEN }} - WEB_EXT_API_KEY: ${{ secrets.WEB_EXT_API_KEY }} - WEB_EXT_API_SECRET: ${{ secrets.WEB_EXT_API_SECRET }}