semantic-release / semantic-release/github
Publish step hanging with partial success - possible globbing issue
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 534
- Forks
- 150
- Avg merge
- 1m
- Merged PRs (30d)
- 3
Description
My issue seems very similar to this closed issue - https://github.com/semantic-release/github/issues/193 - but since that is closed and a couple of years old I figured it might not be relevant.
Even with debug logging turned on, the logs go silent after this log message - https://github.com/semantic-release/github/blob/master/lib/publish.js#L34 . The draft release is created correctly, we just never seem to make it as far as https://github.com/semantic-release/github/blob/master/lib/publish.js#L56 as we never get any additional debug logging. So it seems perhaps there is an issue with the glob step.
The complete log entries from release that are relevant to github plugin are shown below.
[3:29:08 PM] [semantic-release] › ✔ Loaded plugin "verifyConditions" from "@semantic-release/github"
' export RELEASE_VERSION="$RELEASE_VERSION"\n' +
...
2021-05-26T15:29:08.805Z semantic-release:plugins options for @semantic-release/github/verifyConditions: {
assets: [ { path: '**', label: 'distribution files' } ],
failComment: false,
successComment: false
}
...
2021-05-26T15:29:08.805Z semantic-release:plugins options for @semantic-release/github/verifyConditions: {
assets: [ { path: '**', label: 'distribution files' } ],
failComment: false,
successComment: false
}
...
[3:29:08 PM] [semantic-release] › ✔ Loaded plugin "publish" from "@semantic-release/github"
...
[3:29:08 PM] [semantic-release] › ✔ Loaded plugin "addChannel" from "@semantic-release/github"
2021-05-26T15:29:08.811Z semantic-release:plugins options for @semantic-release/github/success: {
assets: [ { path: '**', label: 'distribution files' } ],
failComment: false,
successComment: false
}
...
2021-05-26T15:29:08.812Z semantic-release:plugins options for @semantic-release/github/fail: {
assets: [ { path: '**', label: 'distribution files' } ],
failComment: false,
successComment: false
}
...
[3:29:08 PM] [semantic-release] › ✔ Loaded plugin "success" from "@semantic-release/github"
...
[3:29:08 PM] [semantic-release] › ✔ Loaded plugin "fail" from "@semantic-release/github"
...
[3:29:13 PM] [semantic-release] › ℹ Start step "verifyConditions" of plugin "@semantic-release/github"
[3:29:13 PM] [semantic-release] [@semantic-release/github] › ℹ Verify GitHub authentication (https://api.github.com)
[3:29:13 PM] [semantic-release] › ✔ Completed step "verifyConditions" of plugin "@semantic-release/github"
...
[3:29:20 PM] [semantic-release] › ℹ Start step "publish" of plugin "@semantic-release/github"
2021-05-26T15:29:20.072Z semantic-release:github release object: {
owner: 'onelive-dev',
repo: 'OLX',
tag_name: 'v1.5.0-cicd.3',
target_commitish: 'cicd',
name: 'v1.5.0-cicd.3',
body: '# [1.5.0-cicd.3](https://github.com/onelive-dev/OLX/compare/v1.5.0-cicd.2...v1.5.0-cicd.3) (2021-05-26)\n' +
'\n' +
'\n' +
'### Bug Fixes\n' +
'\n' +
'* **cicd:** enable semantic-release debug + force release ([d262911](https://github.com/onelive-dev/OLX/commit/d26291168b6b82d16d56eed242c12ef60871e8ce))\n' +
'\n' +
'\n' +
'\n',
prerelease: true
}
Our .releaserc.yml file is as follows
branches:
- master
# @todo enable automated release for all branches once some outstanding branches with non-compliant names are closed
# - name: '**'
# prerelease: true
- name: cicd
prerelease: true
plugins:
- '@semantic-release/commit-analyzer'
- '@semantic-release/release-notes-generator'
- '@semantic-release/changelog'
- - '@semantic-release/exec'
# This hook is run only if a release is to be made
# We create source-able file so future workflow steps can easily get to release metadata
- prepareCmd: |
RELEASE_VERSION="${nextRelease.version}"
echo "Version to be released: $RELEASE_VERSION"
cat > version.sh <<-EOF
#!/bin/bash
export RELEASE_VERSION="$RELEASE_VERSION"
export RELEASE_CHANNEL="${nextRelease.channel}"
export RELEASE_HEAD="${nextRelease.gitHead}"
export RELEASE_NOTES="${nextRelease.notes}"
export RELEASE_TAG="${nextRelease.gitTag}"
export RELEASE_TYPE="${nextRelease.type}"
EOF
- - '@semantic-release/npm'
- npmPublish: false
- - '@semantic-release/git'
- assets:
- CHANGELOG.md
- package.json
- package-lock.json
- - '@semantic-release/github'
- assets:
- path: '**'
label: distribution files
failComment: false
successComment: false
Note I am able to make releases by making npm plugin generate a tarball and explicitly using that tarball in assets config. So a config like this works.
branches:
- master
# @todo enable automated release for all branches once some outstanding branches with non-compliant names are closed
# - name: '**'
# prerelease: true
- name: cicd
prerelease: true
plugins:
- '@semantic-release/commit-analyzer'
- '@semantic-release/release-notes-generator'
- '@semantic-release/changelog'
- - '@semantic-release/exec'
# This hook is run only if a release is to be made
# We create source-able file so future workflow steps can easily get to release metadata
- prepareCmd: |
RELEASE_VERSION="${nextRelease.version}"
echo "Version to be released: $RELEASE_VERSION"
cat > version.sh <<-EOF
#!/bin/bash
export RELEASE_VERSION="$RELEASE_VERSION"
export RELEASE_CHANNEL="${nextRelease.channel}"
export RELEASE_HEAD="${nextRelease.gitHead}"
export RELEASE_NOTES="${nextRelease.notes}"
export RELEASE_TAG="${nextRelease.gitTag}"
export RELEASE_TYPE="${nextRelease.type}"
EOF
- - '@semantic-release/npm'
- npmPublish: false
tarballDir: dist
- - '@semantic-release/git'
- assets:
- CHANGELOG.md
- package.json
- package-lock.json
- - '@semantic-release/github'
- assets:
- path: dist/*.tgz
label: distribution files
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in lib/publish.js at the points referenced around lines 34 and 56, then compare the two asset configurations in .releaserc.yml. Reproduce the publish step with the '**' glob and with dist/*.tgz, and use the debug output to isolate the glob step. Done means the configured glob no longer leaves publishing hanging and the release completes with the intended assets.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- github, javascript
- Domain
- release
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100