Skip to content

npm bump

npm bump #167

Workflow file for this run

name: npm bump
on:
workflow_dispatch:
inputs:
newversion:
description: 'npm version (YYYY.MM.DD)'
required: false
deploy-web:
type: boolean
description: 'Deploy web service'
default: true
deploy-worker:
type: boolean
description: 'Deploy worker service'
default: true
env:
node_version: 21
redis-version: 7
FORCE_COLOR: 1
NPM_CONFIG_COLOR: always
concurrency:
group: npm-bump
cancel-in-progress: true
jobs:
version_and_release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Use Node.js ${{ env.node_version }}
uses: actions/setup-node@v4
with:
node-version: ${{ env.node_version }}
registry-url: 'https://registry.npmjs.org'
- name: Start Redis
uses: supercharge/[email protected]
with:
redis-version: ${{ env.redis-version }}
- uses: superfly/flyctl-actions/setup-flyctl@master
- run: npm i
- name: Archive lockfile
uses: actions/upload-artifact@v4
with:
name: package-lock.json
path: package-lock.json
- run: npm run generate-default-env --workspaces --if-present
- run: npm test
- name: Set NEW_VERSION
run: |
if [ -z "${{ github.event.inputs.newversion }}" ]; then
echo "NEW_VERSION=$(date -d "${{ github.event.repository.pushed_at }}" +%Y.%m.%d)" >> $GITHUB_ENV
else
echo "NEW_VERSION=${{ github.event.inputs.newversion }}" >> $GITHUB_ENV
fi
echo $NEW_VERSION
- uses: bcomnes/npm-bump@v2
with:
git_email: [email protected]
git_username: ${{ github.actor }}
newversion: ${{ env.NEW_VERSION }}
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_cmd: npm run release
- name: Deploy web
run: npm run deploy:web
if: ${{ github.event.inputs.deploy-web == 'true' }}
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
- name: Deploy worker
run: npm run deploy:worker
if: ${{ github.event.inputs.deploy-worker == 'true' }}
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}