Initiate Release Workflow #41
This file contains 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: Initiate Release Workflow | |
on: | |
workflow_dispatch: | |
jobs: | |
Release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Setup Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '18.x' | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Install pnpm | |
run: npm install -g [email protected] | |
- name: Install dependencies | |
run: pnpm install | |
- name: Make changes to pull request | |
run: node tools/cli/preRelease.js | |
- name: Extract version from package.json | |
id: extract_version | |
run: | | |
version=$(node -p "require('./packages/teams-js/package.json').version") | |
echo "::set-output name=version::$version" | |
- name: Push base release branch | |
run: | | |
git checkout -b release/${{steps.extract_version.outputs.version}} | |
git push --set-upstream origin release/${{steps.extract_version.outputs.version}} -f | |
- name: Extract changelog for version | |
id: extract_changelog | |
run: | | |
changelog=$(node tools/cli/readChangelog.js ${{steps.extract_version.outputs.version}}) | |
changelog="${changelog//'%'/'%25'}" | |
changelog="${changelog//$'\n'/'%0A'}" | |
changelog="${changelog//$'\r'/'%0D'}" | |
echo -e "::set-output name=changelog::$changelog" | |
- name: Create Pull Request | |
uses: peter-evans/create-pull-request@v3 | |
with: | |
commit-message: Releasing${{steps.extract_version.outputs.version}} | |
title: 'Releasing v${{steps.extract_version.outputs.version}}' | |
body: '${{steps.extract_changelog.outputs.changelog}}' | |
branch: 'actions/release_v${{steps.extract_version.outputs.version}}' | |
base: release/${{steps.extract_version.outputs.version}} | |
delete-branch: true |