forked from open-webui/open-webui
Update build-release.yml
This commit is contained in:
parent
c89c27d351
commit
a3eb7157f0
1 changed files with 13 additions and 6 deletions
19
.github/workflows/build-release.yml
vendored
19
.github/workflows/build-release.yml
vendored
|
@ -13,11 +13,18 @@ jobs:
|
|||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Get commit hash
|
||||
id: get_hash
|
||||
- name: Check for changes in package.json
|
||||
run: |
|
||||
HASH=$(git rev-parse --short "$GITHUB_SHA")
|
||||
echo "::set-output name=hash::$HASH"
|
||||
git diff --cached --diff-filter=d package.json || {
|
||||
echo "No changes to package.json"
|
||||
exit 1
|
||||
}
|
||||
|
||||
- name: Get version number from package.json
|
||||
id: get_version
|
||||
run: |
|
||||
VERSION=$(jq -r '.version' package.json)
|
||||
echo "::set-output name=version::$VERSION"
|
||||
|
||||
- name: Create GitHub release
|
||||
uses: actions/github-script@v5
|
||||
|
@ -27,8 +34,8 @@ jobs:
|
|||
const release = await github.rest.repos.createRelease({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
tag_name: `v${{ steps.get_hash.outputs.hash }}`,
|
||||
name: `v${{ steps.get_hash.outputs.hash }}`,
|
||||
tag_name: `v${{ steps.get_version.outputs.version }}`,
|
||||
name: `v${{ steps.get_version.outputs.version }}`,
|
||||
body: 'Automatically created new release',
|
||||
})
|
||||
console.log(`Created release ${release.data.html_url}`)
|
||||
|
|
Loading…
Reference in a new issue