npm bump #158
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: npm bump | |
on: | |
workflow_dispatch: | |
inputs: | |
newversion: | |
description: 'npm version {major,minor,patch}' | |
required: true | |
env: | |
node_version: 20 | |
FORCE_COLOR: 1 | |
redis-version: 7 | |
concurrency: # prevent concurrent releases | |
group: npm-bump | |
cancel-in-progress: true | |
jobs: | |
version_and_release: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
# fetch full history so things like auto-changelog work properly | |
fetch-depth: 0 | |
- name: Use Node.js ${{ env.node_version }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ env.node_version }} | |
# setting a registry enables the NODE_AUTH_TOKEN env variable where we can set an npm token. REQUIRED | |
registry-url: 'https://registry.npmjs.org' | |
- name: Start Redis | |
uses: supercharge/[email protected] | |
with: | |
redis-version: ${{ env.redis-version }} | |
- run: npm i | |
- run: npm run generate-default-env | |
- run: npm test | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # for api access rate limiting | |
- run: rm .env | |
- run: git reset --hard && git clean -fd | |
- uses: bcomnes/[email protected] | |
with: | |
git_email: [email protected] | |
git_username: ${{ github.actor }} | |
newversion: ${{ github.event.inputs.newversion }} | |
github_token: ${{ secrets.GITHUB_TOKEN }} # built in actions token. Passed tp gh-release if in use. | |
publish_cmd: npm run release | |
- uses: superfly/flyctl-actions/setup-flyctl@master | |
- run: flyctl deploy --remote-only | |
env: | |
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} | |
- name: Archive lockfile | |
uses: actions/upload-artifact@v3 | |
with: | |
name: pacakge-lock.json | |
path: package-lock.json | |