Skip to content

Commit

Permalink
Merge pull request #132 from RDFLib/edmond/versioning
Browse files Browse the repository at this point in the history
Add create-release workflow
  • Loading branch information
edmondchuc authored Jan 24, 2024
2 parents 842b39b + 9391723 commit b783d7c
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/create-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Create release

on:
workflow_dispatch:
inputs:
tag:
description: "Git tag value in sem ver"
required: true
type: string

env:
NODE_VERSION: latest
GIT_MAIN_BRANCH: main

jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
ref: ${{ env.GIT_MAIN_BRANCH }}

- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}

- name: Set up Git user
uses: fregante/setup-git-user@v2

- name: Get release version
id: version
run: echo "VALUE=$(npx --yes semver ${{ github.event.inputs.tag }})" >> "$GITHUB_OUTPUT"

- name: Update project version
run: |
npm version ${{ steps.version.outputs.VALUE }}
git add package.json
git commit -m "chore: release ${{ steps.version.outputs.VALUE }}"
git tag ${{ steps.version.outputs.VALUE }}
git push origin ${{ steps.version.outputs.VALUE }}

0 comments on commit b783d7c

Please sign in to comment.