Added: GitHub Actions workflow for versioning and releases #1
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: Create Tag and Publish Release | |
on: | |
push: | |
branches: | |
- main | |
permissions: | |
contents: write | |
repository-projects: write | |
deployments: write | |
packages: write | |
actions: write | |
jobs: | |
version_and_release: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: "22" | |
cache: "npm" | |
- name: Install dependencies | |
run: npm install | |
- name: Configure Git | |
run: | | |
git config user.name "github-actions[bot]" | |
git config user.email "github-actions[bot]@users.noreply.github.com" | |
- name: Bump version | |
id: bump_version | |
run: | | |
NEW_VERSION=$(npm version patch -m "Bump version to %s") | |
echo "new_version=$NEW_VERSION" >> $GITHUB_OUTPUT | |
- name: Push changes | |
run: | | |
git push origin main | |
git push origin --tags | |
env: | |
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | |
- name: Create Release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | |
with: | |
tag_name: ${{ steps.bump_version.outputs.new_version }} | |
release_name: Release ${{ steps.bump_version.outputs.new_version }} |