Currently when I run yarn nx release
locally i see the changes since the last tag picked up and a changelog file is written like below.
NX Running release version for project: my-project
my-project ???? Reading data for package "@my-monorepo/source" from package.json
my-project ???? Resolved the current version as 0.1.0 from git tag "v0.1.0".
my-project ???? Resolved the specifier as "minor" using git history and the conventional commits standard.
my-project ✍️ New version 0.2.0 written to package.json
UPDATE package.json [dry-run]
"name": "@my-monorepo/source",
- "version": "0.1.0",
+ "version": "0.2.0",
"license": "MIT",
Skipped lock file update because yarn workspaces are not enabled.
NX Staging changed files with git
Would stage files in git with the following command, but --dry-run was set:
git add package.json
NX Previewing an entry in CHANGELOG.md for v0.2.0
UPDATE CHANGELOG.md [dry-run]
+ ## 0.2.0 (2024-06-26)
+
+
+ ### ???? Features
+
+ - add production environment configuration ([COMMIT HASH](GIT COMMIT HASH URL HERE)
However when I try to run this in a github action i’m getting the following
NX Running release version for project: my-project
my-project ???? Reading data for package "@my-monorepo/source" from package.json
my-project ???? Resolved the current version as 0.1.0 from git tag "v0.1.0".
my-project ???? No changes were detected using git history and the conventional commits standard.
my-project ???? Skipping versioning "@my-monorepo/source" as no changes were detected.
And no changelog is generated.
Here is my nx.json config for release and the github action file
"release": {
"projects": ["apps/*", "libs/*", "!*-e2e"],
"version": {
"generatorOptions": {
"currentVersionResolver": "git-tag",
"specifierSource": "conventional-commits"
}
},
"changelog": {
"workspaceChangelog": {
"createRelease": "github"
}
}
},
name: Release
on:
workflow_dispatch:
push:
branches:
- main
paths:
# ignore push events that only include package.json or CHANGELOG.md files
- '!package.json'
- '!CHANGELOG.md'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Fetch Tags
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: git fetch origin --tags
- name: Enable Corepack
run: corepack enable
- uses: actions/setup-node@v4
with:
node-version: 20.15.0
cache: 'yarn'
- name: Restore cached npm Dependencies
id: cache-dependencies-restore
uses: actions/cache/restore@v4
with:
path: |
node_modules
~/.cache/Cypress # needed for the Cypress binary
key: npm-dependencies-${{ hashFiles('yarn.lock') }}
- name: Install Dependencies
run: SKIP_POSTINSTALL=1 yarn install # will run `yarn install` command
- name: Run Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: yarn nx release
I have tried both Yarn and Npm and neither work in github actions for me. But both work locally
Expected Behavior
I should see the changelog generated through github workflow.
I tried both Yarn and NPM and neither worked. Working fine locally just not in github actions