Skip to content

Release

Release #4

Workflow file for this run

name: Release
on:
workflow_dispatch:
inputs:
release-type:
description: 'Type of release'
required: true
type: choice
options:
- patch
- minor
- major
default: patch
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies
run: npm ci
- name: Update version in package.json
run: |
npm version ${{ inputs.release-type }} --no-git-tag-version
echo "NEW_VERSION=$(node -p 'require("./package.json").version')" >> $GITHUB_ENV
- name: Build
run: npm run build
- name: Run tests
run: npm test
- name: Commit version bump
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add package.json
git commit -m "chore: bump version to ${{ env.NEW_VERSION }}"
git tag "v${{ env.NEW_VERSION }}"
- name: Push changes
run: |
git push origin HEAD:main
git push origin "v${{ env.NEW_VERSION }}"
- name: Publish to npm
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Create GitHub Release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ env.NEW_VERSION }}
release_name: v${{ env.NEW_VERSION }}
body: |
Release of context-connectors version ${{ env.NEW_VERSION }}
## Installation
```bash
npm install @augmentcode/context-connectors@${{ env.NEW_VERSION }}
```
## Changes
See the [README](https://github.com/${{ github.repository }}/blob/main/README.md) for details.
draft: false
prerelease: false