Skip to content

Commit

Permalink
chore: update publish workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianwessel committed Feb 25, 2024
1 parent 9f5a34a commit 9356432
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
19 changes: 14 additions & 5 deletions .github/workflows/release_version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,22 +53,31 @@ jobs:
git config --global user.name '${{ vars.CI_COMMIT_AUTHOR}}'
git config --global user.email '[email protected]'
git config --global push.followTags true
scripts/commitVersion.sh
./scripts/commitVersion.sh
echo New version:
echo $(node -p -e "require('./package.json').version")
new_version=$(node -p -e "require('./package.json').version")
echo "new_version=$new_version" >> $GITHUB_OUTPUT
id: bump_version
- name: Commit version bump
uses: planetscale/[email protected]
with:
commit_message: 'chore: bump ${{ inputs.version }} version to v${{ steps.bump_version.outputs.new_version }}'
repo: ${{ github.repository }}
branch: ${{ github.head_ref || github.ref_name }}
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
- name: Add Tag
run: |
git tag ${{ steps.bump_version }}
git tag -a "v${{ steps.bump_version.outputs.new_version }}" -m "v${{ steps.bump_version.outputs.new_version }}"
- name: Dry run publish
run: |
npm publish --access public --dry-run --workspaces
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Commit version
- name: Push to origin
run: |
git push origin --tags --follow-tags
- name: Publish
- name: Publish to NPM
run: npm publish --access public --workspaces
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
6 changes: 3 additions & 3 deletions scripts/commitVersion.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ do
echo $CONTENT > ./packages/${dir##*/}/src/version.ts
done

git add .
git commit -am "chore: bump versions to $NODE_VERSION" -S
git tag -a v$NODE_VERSION -m "v$NODE_VERSION"
#git add .
#git commit -am "chore: bump versions to $NODE_VERSION" -S
#git tag -a v$NODE_VERSION -m "v$NODE_VERSION"

0 comments on commit 9356432

Please sign in to comment.