Skip to content

build: Add size limit info to releases #7203

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
38 changes: 38 additions & 0 deletions .github/workflows/release-size-info.yml
Original file line number Diff line number Diff line change
@@ -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/<tag_name>
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'