diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index dd293aedac8f..6a9f6372afb9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -275,7 +275,7 @@ jobs: needs: [job_get_metadata, job_build] timeout-minutes: 15 runs-on: ubuntu-20.04 - if: github.event_name == 'pull_request' || needs.job_get_metadata.outputs.is_develop == 'true' + if: github.event_name == 'pull_request' || needs.job_get_metadata.outputs.is_develop == 'true' || needs.job_get_metadata.outputs.is_release == 'true' steps: - name: Check out current commit (${{ needs.job_get_metadata.outputs.commit_label }}) uses: actions/checkout@v3 diff --git a/.github/workflows/release-size-info.yml b/.github/workflows/release-size-info.yml new file mode 100644 index 000000000000..eae4a766d662 --- /dev/null +++ b/.github/workflows/release-size-info.yml @@ -0,0 +1,38 @@ +name: Add size info to release +on: + release: + types: + - published + workflow_dispatch: + inputs: + version: + description: Which version to add size info for + required: false + +# This workflow is triggered when a release is published +# It fetches the size-limit info from the release branch and adds it to the release +jobs: + release-size-info: + runs-on: ubuntu-20.04 + name: 'Add size-limit info to release' + + steps: + # https://github.com/actions-ecosystem/action-regex-match + - uses: actions-ecosystem/action-regex-match@v2 + id: head_version + with: + # Parse version from head ref, which is refs/tags/ + text: ${{ github.head_ref }} + regex: '^refs\/tags\/([\d.]+)$' + + - name: Get version + id: get_version + run: echo "version=${{ github.event.inputs.version || steps.head_version.outputs.match }}" >> $GITHUB_OUTPUT + + - name: Update Github Release + if: steps.get_version.outputs.version != '' + uses: getsentry/size-limit-release@v1 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + version: ${{ steps.get_version.outputs.version }} + workflow_name: 'Build & Test'