-
Notifications
You must be signed in to change notification settings - Fork 132
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
5 changed files
with
117 additions
and
98 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 |
---|---|---|
@@ -0,0 +1,57 @@ | ||
on: | ||
workflow_call: | ||
inputs: | ||
isRelease: | ||
description: flag a release invocation | ||
type: boolean | ||
default: false | ||
version: | ||
description: version to apply to package.json files | ||
type: string | ||
required: true | ||
jobs: | ||
apply-version: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- id: checkout | ||
name: checkout project | ||
uses: actions/checkout@v3 | ||
|
||
- id: installNode | ||
name: Use Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18.x | ||
cache: 'npm' | ||
|
||
# generate changelog if its a release | ||
- id: generateReleaseChangelog | ||
name: create release changelog | ||
if: ${{ inputs.isRelease }} | ||
run: echo "generate change log" | ||
|
||
# apply version to package.json files and create a git tag | ||
- id: applyVersion | ||
name: apply version to package.json files | ||
env: | ||
VERSION: ${{ inputs.version }} | ||
IS_RELEASE: ${{ inputs.isRelease }} | ||
run: | | ||
export RELEASE_COMMENT="" | ||
if [ "$IS_RELEASE" == "true" ]; then | ||
RELEASE_COMMENT="release" | ||
fi | ||
npm version -m "apply $RELEASE_COMMENT version $VERSION" | ||
# create release PR | ||
- id: createReleasePR | ||
name: create release PR | ||
if: ${{ inputs.isRelease }} | ||
run: echo "create release PR" | ||
|
||
|
||
|
||
|
||
|
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,47 @@ | ||
on: | ||
workflow_call: | ||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
if: ${{ github.repository == 'aacerox/node-rest-client' }} | ||
steps: | ||
# checkout repo | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
fetch-tags: true | ||
# read latest tag | ||
- id: readLatestTag | ||
name: read latest tag | ||
run: echo "latestTag=$(git describe --tags --abbrev=0)" >> "$GITHUB_OUTPUT" | ||
# setup node.js | ||
- name: Setup Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 18.x | ||
cache: 'npm' | ||
# install repo dependencies | ||
- id: cleanInstallRepo | ||
name: clean install repo | ||
run: npm ci | ||
# run changeset action | ||
# - when push from normal PR: the 'version' command is executed. A new release branch and PR | ||
# is created if it doesn't exists and if it does exists the commit is added to release branch | ||
# | ||
# - when push from release PR: the 'publish' command is executed and artifact are published to npm | ||
- id: changesetPR | ||
name: Changeset release | ||
uses: changesets/action@v1 | ||
env: | ||
NRC_RELEASE_MSG: "node-rest-client release ${{ steps.readLatestTag.outputs.latestTag }}" | ||
GITHUB_TOKEN: ${{ secrets.NRC_GITHUB_TOKEN }} | ||
with: | ||
version: npm run version:packages | ||
publish: npm run publish:packages | ||
commit: "chore(release): ${{ env.NRC_RELEASE_MSG }}" | ||
title: "${{ env.NRC_RELEASE_MSG }}" | ||
|
||
|
||
|
||
|
||
|
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.