-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
38 additions
and
77 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,8 @@ | ||
name: 'Fixed version bump' | ||
description: 'Bumps version for fixed packages and the root package.json using changests.' | ||
inputs: | ||
before-bump: | ||
description: 'Script to run before bumping the version' | ||
required: false | ||
after-bump: | ||
description: 'Script to run after bumping the version' | ||
required: false | ||
outputs: | ||
changelog: | ||
description: 'The current changelog' | ||
version: | ||
description: 'The new version' | ||
runs: | ||
using: 'node20' | ||
main: 'index.js' |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,16 +30,15 @@ jobs: | |
run: | | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "cloud-sdk-js" | ||
# - name: Bump version | ||
# run: yarn run version | ||
- name: Bump version | ||
id: bump | ||
uses: ./.github/actions/changesets-fixed-version-bump | ||
with: | ||
before-bump: yarn ts-node ${{ github.workspace }}/scripts/before-bump.ts | ||
after-bump: | | ||
yarn generate | ||
yarn doc | ||
- run: | | ||
yarn ts-node ${{ github.workspace }}/scripts/update-documentation-md.ts | ||
yarn generate | ||
yarn doc | ||
env: | ||
NEXT_PACKAGE_VERSION: ${{ steps.bump.outputs.version }} | ||
- id: get-workspaces | ||
run: | | ||
workspaces=`yarn -s ts-node ${{ github.workspace }}/scripts/get-workspaces.ts` | ||
|
@@ -57,4 +56,4 @@ jobs: | |
- name: Commit and tag | ||
uses: ./.github/actions/commit-and-tag | ||
with: | ||
version: ${{ steps.merge-changelogs.outputs.changelog }} | ||
version: ${{ steps.bump.outputs.version }} |
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
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { resolve } from 'node:path'; | ||
import { unixEOL } from '@sap-cloud-sdk/util'; | ||
import { transformFile } from './util'; | ||
import { exit } from 'node:process'; | ||
|
||
async function updateDocumentationMd() { | ||
if (!process.env.NEXT_PACKAGE_VERSION) { | ||
throw new Error('NEXT_PACKAGE_VERSION is not set!'); | ||
} | ||
await transformFile(resolve('DOCUMENTATION.md'), documentation => | ||
documentation | ||
.split(unixEOL) | ||
.map(line => | ||
line.startsWith('## Version:') | ||
? `## Version: ${process.env.NEXT_PACKAGE_VERSION}` | ||
: line | ||
) | ||
.join(unixEOL) | ||
); | ||
} | ||
|
||
updateDocumentationMd().catch(err => { | ||
console.error(err); | ||
exit(1); | ||
}); |