1
0
mirror of https://github.com/redis/node-redis.git synced 2025-12-25 00:40:59 +03:00
Files
node-redis/.github/workflows/release.yml
Nikolay Karadzhov d9a6bb376f chore(release): use deploy keys for relese (#3013)
main branch is protected and does not allow direct pushes.
the release action needs to push.
branch protection rules can be bypassed for people and apps, but not
github actions.

one of the workarounds is to use a ruleset in which we set a deploy key

see: https://github.com/orgs/community/discussions/25305\#discussioncomment-10728028
2025-07-08 14:28:50 +03:00

52 lines
1.5 KiB
YAML

name: Release
on:
workflow_dispatch:
inputs:
version:
description: 'Version to release ("major", "minor", "patch", or "pre*" version; or specify version like "5.3.3")'
required: true
type: string
args:
description: 'Additional arguments to pass to release-it (e.g. "--dry-run"). See docs: https://github.com/release-it/release-it/blob/main/docs/git.md#configuration-options'
required: false
type: string
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
packages: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
ssh-key: ${{ secrets.RELEASE_KEY }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies
run: npm ci
- name: Configure Git
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
# Build all packages
- name: Build packages
run: npm run build
# Release using the monorepo approach
- name: Release packages
run: npm run release -- --ci -i ${{ github.event.inputs.version }} ${{ github.event.inputs.args }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}