v3.22.2 #453
Workflow file for this run
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: release | |
on: | |
release: | |
types: [published] | |
jobs: | |
stable-release: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: 'main' | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 22 | |
registry-url: 'https://registry.npmjs.org' | |
- run: yarn install --frozen-lockfile --ignore-engines | |
- name: Legacy Release | |
if: startsWith(github.ref, 'refs/tags/v1') || startsWith(github.ref, 'refs/tags/v2') | |
run: | | |
yarn changeset publish --tag legacy | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPMJS_ACCESS_TOKEN }} | |
- name: Latest Release | |
if: startsWith(github.ref, 'refs/tags/v3') | |
run: | | |
yarn changeset publish | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPMJS_ACCESS_TOKEN }} | |
- name: Checkout Docs | |
uses: actions/checkout@v4 | |
with: | |
repository: SAP/cloud-sdk | |
token: ${{ secrets.GH_DOCS_TOKEN }} | |
fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository. | |
path: ./cloud-sdk | |
- name: Update release notes | |
run: | | |
npx ts-node -e "import { addCurrentChangelog } from './scripts/add-changelog'; addCurrentChangelog()" | |
- name: Open PR | |
run: | | |
cd cloud-sdk | |
git config --local user.email "${{ secrets.GH_DOCS_EMAIL }}" | |
git config --local user.name "${{ secrets.GH_DOCS_USER }}" | |
git checkout -b "update-release-notes" | |
git commit -m "update release notes" -a | |
git push -u origin update-release-notes | |
echo ${{ secrets.GH_DOCS_TOKEN }} | gh auth login --hostname github.com --with-token | |
gh config set prompt disabled | |
PR_BODY="Auto-created by update release notes workflow." | |
PR_TITLE="Update JS Release Notes" | |
gh pr create --head "update-release-notes" --title "${PR_TITLE}" --body "${PR_BODY}" |