Release #157
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release | |
| on: | |
| # Manual releases | |
| workflow_dispatch: | |
| inputs: | |
| release_type: | |
| description: 'type' | |
| required: true | |
| type: choice | |
| options: | |
| - 'rc' | |
| - 'stable' | |
| - 'hotfix' | |
| - 'experimental' | |
| - 'v1' | |
| default: 'rc' | |
| new_version: | |
| description: 'version (relevant for stable, hotfix, and v1)' # Updated description | |
| required: false | |
| default: '' | |
| type: string | |
| # Scheduled automatic RC releases | |
| schedule: | |
| - cron: "00 08 * * THU" # Thursdays at 8 AM UTC | |
| jobs: | |
| # ✅ Job 1: Stable Release Flow | |
| stable-release: | |
| if: ${{ github.event.inputs.release_type == 'stable' }} | |
| environment: "npmjs:@ui5/webcomponents" | |
| permissions: | |
| contents: write | |
| id-token: write | |
| issues: write | |
| pull-requests: write | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Generate App Token | |
| id: app-token | |
| uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0 | |
| with: | |
| app-id: ${{ secrets.RELEASE_APP_ID }} | |
| private-key: ${{ secrets.RELEASE_APP_KEY }} | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| token: ${{ steps.app-token.outputs.token }} | |
| fetch-depth: 0 | |
| - name: Setup Node | |
| uses: actions/setup-node@v4.1.0 | |
| with: | |
| node-version: 22 | |
| cache: 'yarn' | |
| - name: Install Dependencies | |
| run: yarn --immutable | |
| - name: Version Bump | |
| env: | |
| GH_TOKEN: ${{ steps.app-token.outputs.token }} | |
| run: | | |
| git config user.name "${{ secrets.UI5_WEBCOMP_BOT_NAME }}" | |
| git config user.email "${{ secrets.UI5_WEBCOMP_BOT_EMAIL }}" | |
| yarn lerna version ${{ github.event.inputs.new_version || '' }} \ | |
| --conventional-graduate \ | |
| --force-conventional-graduate \ | |
| --yes \ | |
| --exact \ | |
| --no-push | |
| - name: Build | |
| run: yarn ci:releasebuild | |
| - name: Push Changes | |
| run: | | |
| git push origin HEAD | |
| git push origin --tags | |
| - name: Create GitHub Release | |
| uses: actions/github-script@v7 | |
| env: | |
| GH_TOKEN: ${{ steps.app-token.outputs.token }} | |
| with: | |
| github-token: ${{ steps.app-token.outputs.token }} | |
| script: | | |
| const extractChangelog = (await import('${{ github.workspace }}/.github/actions/extractChangelog.mjs')).default; | |
| const changelog = await extractChangelog(); | |
| const version = require('./lerna.json').version; | |
| await github.rest.repos.createRelease({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| tag_name: `v${version}`, | |
| name: `v${version}`, | |
| body: changelog, | |
| }); | |
| - name: Publish | |
| run: | | |
| yarn lerna publish from-git --yes | |
| - name: Merge Release Changelog | |
| uses: actions/github-script@v7 | |
| env: | |
| GH_TOKEN: ${{ steps.app-token.outputs.token }} | |
| with: | |
| github-token: ${{ steps.app-token.outputs.token }} | |
| script: | | |
| const mergeReleaseChangelog = (await import('${{ github.workspace }}/.github/actions/mergeReleaseChangelog.mjs')).default; | |
| await mergeReleaseChangelog({ github , context }); | |
| - name: Publish Release Comments | |
| uses: actions/github-script@v7 | |
| env: | |
| NODE_OPTIONS: '--max-old-space-size=12096' | |
| GH_TOKEN: ${{ steps.app-token.outputs.token }} | |
| with: | |
| github-token: ${{ steps.app-token.outputs.token }} | |
| script: | | |
| const commentOnFixedIssues = (await import('${{ github.workspace }}/.github/actions/commentOnFixedIssues.mjs')).default; | |
| await commentOnFixedIssues({ github, context }); | |
| - name: Pre-Deploy | |
| env: | |
| DEPLOYMENT_TYPE: "latest" | |
| run: | | |
| yarn ci:deploy | |
| - name: Deploy | |
| uses: JamesIves/github-pages-deploy-action@v4.3.3 | |
| with: | |
| token: ${{ steps.app-token.outputs.token }} | |
| branch: gh-pages # The branch the action should deploy to. | |
| folder: packages/website/build # The folder the action should deploy. | |
| clean: true | |
| clean-exclude: | | |
| nightly | |
| v1 | |
| googlea519d963aa8f580f.html | |
| # ✅ Job 2: RC Release Flow | |
| rc-release: | |
| if: ${{ github.event.inputs.release_type == 'rc' || github.event_name == 'schedule' }} | |
| environment: "npmjs:@ui5/webcomponents" | |
| permissions: | |
| contents: write | |
| id-token: write | |
| issues: write | |
| pull-requests: write | |
| pages: write | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Generate App Token | |
| id: app-token | |
| uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0 | |
| with: | |
| app-id: ${{ secrets.RELEASE_APP_ID }} | |
| private-key: ${{ secrets.RELEASE_APP_KEY }} | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| token: ${{ steps.app-token.outputs.token }} | |
| fetch-depth: 0 | |
| - name: Setup Node | |
| uses: actions/setup-node@v4.1.0 | |
| with: | |
| node-version: 22 | |
| cache: 'yarn' | |
| - name: Install Dependencies | |
| run: yarn --immutable | |
| - name: Version Bump | |
| env: | |
| GH_TOKEN: ${{ steps.app-token.outputs.token }} | |
| run: | | |
| git config user.name "${{ secrets.UI5_WEBCOMP_BOT_NAME }}" | |
| git config user.email "${{ secrets.UI5_WEBCOMP_BOT_EMAIL }}" | |
| yarn lerna version \ | |
| --conventional-prerelease \ | |
| --force-publish \ | |
| --yes \ | |
| --exact \ | |
| --no-push | |
| - name: Build | |
| run: yarn ci:releasebuild | |
| - name: Push Changes | |
| run: | | |
| # Rebase the local lerna version-bump commit onto the latest remote | |
| # branch in case other commits landed during the build, then re-point | |
| # the tag(s) lerna created so they reference the rebased commit. | |
| NEW_TAGS=$(git tag --points-at HEAD) | |
| git fetch origin ${{ github.ref_name }} | |
| git rebase origin/${{ github.ref_name }} | |
| for tag in $NEW_TAGS; do | |
| git tag -f "$tag" HEAD | |
| done | |
| git push origin HEAD | |
| git push origin --tags | |
| - name: Create GitHub Release | |
| uses: actions/github-script@v7 | |
| env: | |
| GH_TOKEN: ${{ steps.app-token.outputs.token }} | |
| with: | |
| github-token: ${{ steps.app-token.outputs.token }} | |
| script: | | |
| const extractChangelog = (await import('${{ github.workspace }}/.github/actions/extractChangelog.mjs')).default; | |
| const changelog = await extractChangelog(); | |
| const version = require('./lerna.json').version; | |
| await github.rest.repos.createRelease({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| tag_name: `v${version}`, | |
| name: `v${version}`, | |
| body: changelog, | |
| prerelease: true, | |
| }); | |
| - name: Publish | |
| run: | | |
| yarn lerna publish from-git --yes | |
| - name: Pre-Deploy | |
| run: | | |
| yarn ci:deploy:nightly | |
| - name: Deploy to GitHub Pages | |
| uses: JamesIves/github-pages-deploy-action@v4.3.3 | |
| with: | |
| token: ${{ steps.app-token.outputs.token }} | |
| branch: gh-pages | |
| folder: packages/website/build | |
| target-folder: nightly | |
| clean: true | |
| - name: Publish Release Comments | |
| uses: actions/github-script@v7 | |
| env: | |
| NODE_OPTIONS: '--max-old-space-size=12096' | |
| GH_TOKEN: ${{ steps.app-token.outputs.token }} | |
| with: | |
| github-token: ${{ steps.app-token.outputs.token }} | |
| script: | | |
| const commentOnFixedIssues = (await import('${{ github.workspace }}/.github/actions/commentOnFixedIssues.mjs')).default; | |
| await commentOnFixedIssues({ github, context }); | |
| # ✅ Job 3: Hotfix Release Flow | |
| hotfix-release: | |
| if: ${{ github.event.inputs.release_type == 'hotfix' && github.event.inputs.new_version != '' }} | |
| environment: "npmjs:@ui5/webcomponents" | |
| permissions: | |
| contents: write | |
| id-token: write | |
| issues: write | |
| pull-requests: write | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Generate App Token | |
| id: app-token | |
| uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0 | |
| with: | |
| app-id: ${{ secrets.RELEASE_APP_ID }} | |
| private-key: ${{ secrets.RELEASE_APP_KEY }} | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| token: ${{ steps.app-token.outputs.token }} | |
| fetch-depth: 0 | |
| - name: Setup Node | |
| uses: actions/setup-node@v4.1.0 | |
| with: | |
| node-version: 22 | |
| cache: 'yarn' | |
| - name: Install Dependencies | |
| run: yarn --immutable | |
| - name: Version Bump | |
| env: | |
| GH_TOKEN: ${{ steps.app-token.outputs.token }} | |
| run: | | |
| git config user.name "${{ secrets.UI5_WEBCOMP_BOT_NAME }}" | |
| git config user.email "${{ secrets.UI5_WEBCOMP_BOT_EMAIL }}" | |
| yarn lerna version ${{ github.event.inputs.new_version || '' }} \ | |
| --conventional-graduate \ | |
| --force-conventional-graduate \ | |
| --yes \ | |
| --exact \ | |
| --no-push | |
| - name: Build | |
| run: yarn ci:releasebuild | |
| - name: Push Changes | |
| run: | | |
| git push origin HEAD | |
| git push origin --tags | |
| - name: Create GitHub Release | |
| uses: actions/github-script@v7 | |
| env: | |
| GH_TOKEN: ${{ steps.app-token.outputs.token }} | |
| with: | |
| github-token: ${{ steps.app-token.outputs.token }} | |
| script: | | |
| const extractChangelog = (await import('${{ github.workspace }}/.github/actions/extractChangelog.mjs')).default; | |
| const changelog = await extractChangelog(); | |
| const version = require('./lerna.json').version; | |
| await github.rest.repos.createRelease({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| tag_name: `v${version}`, | |
| name: `v${version}`, | |
| body: changelog, | |
| make_latest: 'false', | |
| }); | |
| - name: Publish | |
| run: | | |
| major_minor=$(echo "${{ github.event.inputs.new_version }}" | cut -d. -f1,2) | |
| yarn lerna publish from-git --yes --dist-tag "hotfix-${major_minor}" | |
| # ✅ Job 4: Experimental Release Flow | |
| experimental-release: | |
| if: ${{ github.event.inputs.release_type == 'experimental' }} | |
| environment: "npmjs:@ui5/webcomponents" | |
| permissions: | |
| contents: read | |
| id-token: write | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Node | |
| uses: actions/setup-node@v4.1.0 | |
| with: | |
| node-version: 22 | |
| cache: 'yarn' | |
| - name: Install Dependencies | |
| run: yarn --immutable | |
| - name: Version Bump | |
| run: | | |
| git config user.name "${{ secrets.UI5_WEBCOMP_BOT_NAME }}" | |
| git config user.email "${{ secrets.UI5_WEBCOMP_BOT_EMAIL }}" | |
| git_hash=$(git rev-parse --short "${{ github.sha }}") | |
| yarn lerna version "0.0.0-${git_hash}" \ | |
| --exact \ | |
| --no-push \ | |
| --yes \ | |
| --allow-branch ${{ github.ref_name }} \ | |
| --ignore-changes @ui5/webcomponents-website \ | |
| --ignore-changes @ui5/webcomponents-cypress-internal \ | |
| --ignore-changes @ui5/webcomponents-cypress-ct | |
| - name: Build | |
| run: yarn ci:releasebuild | |
| - name: Publish | |
| run: | | |
| yarn lerna publish from-git --yes --dist-tag experimental --pre-dist-tag experimental | |
| # ✅ Job 5: V1 Release Flow | |
| v1-release: | |
| if: ${{ github.event.inputs.release_type == 'v1' && github.event.inputs.new_version != '' }} | |
| environment: "npmjs:@ui5/webcomponents" | |
| permissions: | |
| contents: write | |
| id-token: write | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Generate App Token | |
| id: app-token | |
| uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0 | |
| with: | |
| app-id: ${{ secrets.RELEASE_APP_ID }} | |
| private-key: ${{ secrets.RELEASE_APP_KEY }} | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| token: ${{ steps.app-token.outputs.token }} | |
| fetch-depth: 0 | |
| - name: Setup Node | |
| uses: actions/setup-node@v4.1.0 | |
| with: | |
| node-version: 22 | |
| cache: 'yarn' | |
| - name: Install Dependencies | |
| run: yarn --immutable | |
| - name: Version Bump | |
| env: | |
| GH_TOKEN: ${{ steps.app-token.outputs.token }} | |
| run: | | |
| git config user.name "${{ secrets.UI5_WEBCOMP_BOT_NAME }}" | |
| git config user.email "${{ secrets.UI5_WEBCOMP_BOT_EMAIL }}" | |
| yarn lerna version ${{ github.event.inputs.new_version || '' }} \ | |
| --conventional-graduate \ | |
| --force-conventional-graduate \ | |
| --yes \ | |
| --exact \ | |
| --create-release github | |
| - name: Build | |
| run: yarn ci:releasebuild | |
| - name: Publish | |
| run: | | |
| yarn lerna publish from-git --yes --dist-tag "v1" |