build(deps-dev): bump simple-git from 3.26.0 to 3.27.0 #1410
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Node.js Package | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
- master | |
- v[0-9]+ | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
db: [couch, elasticsearch, mongo, mysql, redis, mock, sqlite, redis, memory, rusty] | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
- uses: pnpm/action-setup@v4 | |
name: Install pnpm | |
with: | |
version: 9 | |
run_install: false | |
- name: Get pnpm store directory | |
shell: bash | |
run: | | |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV | |
- uses: actions/cache@v4 | |
name: Setup pnpm cache | |
with: | |
path: ${{ env.STORE_PATH }} | |
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-pnpm-store- | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- run: pnpm i | |
name: Install pnpm dependencies | |
- run: pnpm run test ${{ matrix.db }} | |
publish-npm: | |
if: github.event_name == 'push' | |
needs: | |
- test | |
runs-on: ubuntu-latest | |
steps: | |
- | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- | |
uses: actions/setup-node@v4 | |
- uses: pnpm/action-setup@v4 | |
name: Install pnpm | |
with: | |
version: 9 | |
run_install: false | |
- name: Get pnpm store directory | |
shell: bash | |
run: | | |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV | |
- uses: actions/cache@v4 | |
name: Setup pnpm cache | |
with: | |
path: ${{ env.STORE_PATH }} | |
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-pnpm-store- | |
# This is required if the package has a prepare script that uses something | |
# in dependencies or devDependencies. This is also needed for bumping the | |
# version. | |
- | |
run: pnpm i | |
# Workaround based on https://github.com/pnpm/pnpm/issues/3141 | |
- name: Set publishing config | |
run: pnpm config set '//registry.npmjs.org/:_authToken' "${NODE_AUTH_TOKEN}" | |
env: | |
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} | |
- | |
name: Bump version (patch) | |
run: | | |
LATEST_TAG=$(git describe --tags --abbrev=0) || exit 1 | |
NEW_COMMITS=$(git rev-list --count "${LATEST_TAG}"..) || exit 1 | |
[ "${NEW_COMMITS}" -gt 0 ] || exit 0 | |
git config user.name 'github-actions[bot]' | |
git config user.email '41898282+github-actions[bot]@users.noreply.github.com' | |
pnpm version patch | |
# Update the branch before pushing the tag in case the branch can't be | |
# fast-forwarded. | |
git push | |
git push --follow-tags | |
# `npm publish` must come after `git push` otherwise there is a race | |
# condition: If two PRs are merged back-to-back then master/main will be | |
# updated with the commits from the second PR before the first PR's | |
# workflow has a chance to push the commit generated by `npm version | |
# patch`. This causes the first PR's `git push` step to fail after the | |
# package has already been published, which in turn will cause all future | |
# workflow runs to fail because they will all attempt to use the same | |
# already-used version number. By running `npm publish` after `git push`, | |
# back-to-back merges will cause the first merge's workflow to fail but | |
# the second's will succeed. | |
- | |
name: Convert typescript and create dist folder | |
run: pnpm run build | |
- | |
run: pnpm publish | |
- | |
name: Add package to etherpad organization | |
run: npm access grant read-write etherpad:developers ueberdb2 | |
env: | |
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} |