npm bump #8
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 (YYYY.MM.DD)' | |
required: false | |
env: | |
FORCE_COLOR: 1 | |
NPM_CONFIG_COLOR: always | |
node_version: lts/* | |
python_version: '3.x' | |
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' | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ env.python_version }} | |
architecture: 'x64' | |
- uses: superfly/flyctl-actions/setup-flyctl@master | |
- name: Install Protoc using apt-get | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y protobuf-compiler | |
- name: Verify protoc installation | |
run: protoc --version | |
- run: npm i | |
- name: Archive lockfile | |
uses: actions/upload-artifact@v4 | |
with: | |
name: package-lock.json | |
path: package-lock.json | |
- 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 | |
- run: flyctl deploy --remote-only | |
env: | |
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} |