-
Notifications
You must be signed in to change notification settings - Fork 57
54 lines (51 loc) · 1.93 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
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}"