fix build

This commit is contained in:
Rodrigo Fernandes 2024-12-23 22:49:18 +00:00
parent 064659a70e
commit 2f8c477f66
No known key found for this signature in database

View file

@ -25,7 +25,7 @@ jobs:
run: | run: |
export NEXT_VERSION="$(/bin/git-version --folder=$PWD --release-branch=master)" export NEXT_VERSION="$(/bin/git-version --folder=$PWD --release-branch=master)"
echo "Next version is ${NEXT_VERSION}" echo "Next version is ${NEXT_VERSION}"
echo "${NEXT_VERSION}" > .version echo "${NEXT_VERSION}" > next-version.txt
echo "version=${NEXT_VERSION}" >> $GITHUB_ENV echo "version=${NEXT_VERSION}" >> $GITHUB_ENV
- name: Get next npm tag name - name: Get next npm tag name
run: | run: |
@ -37,15 +37,15 @@ jobs:
export PUBLISH_TAG="pr" export PUBLISH_TAG="pr"
fi fi
echo "Next tag is ${PUBLISH_TAG}" echo "Next tag is ${PUBLISH_TAG}"
echo "${PUBLISH_TAG}" > .tag echo "${PUBLISH_TAG}" > publish-tag.txt
- name: Upload versions - name: Upload versions
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
name: versions name: versions
if-no-files-found: error if-no-files-found: error
path: | path: |
.version next-version.txt
.tag publish-tag.txt
build: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
@ -86,7 +86,7 @@ jobs:
with: with:
name: versions name: versions
- name: Store version - name: Store version
run: echo "version=$(cat .version)" >> $GITHUB_ENV run: echo "version=$(cat next-version.txt)" >> $GITHUB_ENV
- name: Configure Git - name: Configure Git
run: | run: |
git config user.email "gh-actions@users.noreply.github.com" git config user.email "gh-actions@users.noreply.github.com"
@ -115,9 +115,9 @@ jobs:
- name: Version package - name: Version package
run: | run: |
# Update version in packages to publish # Update version in packages to publish
npm version $(cat .version) -m "Release version %s" npm version $(cat next-version.txt) -m "Release version %s"
- name: Publish to NPM - name: Publish to NPM
run: npm publish --tag $(cat .tag) run: npm publish --tag $(cat publish-tag.txt)
- uses: actions/setup-node@v3 - uses: actions/setup-node@v3
with: with:
node-version: '18.x' node-version: '18.x'
@ -136,8 +136,8 @@ jobs:
run: | run: |
# HACK: Override npm package name to be able to publish in GitHub # HACK: Override npm package name to be able to publish in GitHub
sed -i 's/^ "name":.*/ "name": "@rtfpessoa\/diff2html",/g' package.json sed -i 's/^ "name":.*/ "name": "@rtfpessoa\/diff2html",/g' package.json
echo "Going to publish version $(cat .version) to GitHub" echo "Going to publish version $(cat next-version.txt) to GitHub"
npm publish --tag $(cat .tag) npm publish --tag $(cat publish-tag.txt)
# HACK: Restore npm package name # HACK: Restore npm package name
sed -i 's/^ "name":.*/ "name": "diff2html",/g' package.json sed -i 's/^ "name":.*/ "name": "diff2html",/g' package.json
- name: Upload docs - name: Upload docs