Skip to content
This repository has been archived by the owner on Jun 18, 2024. It is now read-only.

Commit

Permalink
First commit, configure release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
pablovilas committed Jun 9, 2024
1 parent 544e652 commit 1eab8b8
Show file tree
Hide file tree
Showing 2 changed files with 4,722 additions and 3,774 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Release Version

on: workflow_dispatch

permissions:
contents: write
packages: read
statuses: write

jobs:
release:
name: Release Version
runs-on: ubuntu-latest

steps:
- name: Checkout
id: checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Create Release
id: release
run: |
VERSION_NUMBER=$(grep '"version"' package.json | cut -d '"' -f 4)
MAJOR_VERSION_NUMBER=$(echo "$VERSION_NUMBER" | cut -d '.' -f 1)
VERSION=$(echo "v$VERSION_NUMBER")
MAJOR_VERSION=$(echo "v$MAJOR_VERSION_NUMBER")
# Prepare code to upload
npm run all
git config user.name github-actions
git config user.email [email protected]
git add .
git commit -m "Version $VERSION"
git push origin main
# Create or update a Git tag with the version number
git tag -f -a "$VERSION" -m "Version $VERSION"
# Check if the major tag already exists
if git rev-parse "$MAJOR_VERSION" >/dev/null 2>&1; then
# Update the existing major tag
git tag -f -a "$MAJOR_VERSION" -m "Version $MAJOR_VERSION"
else
# Create a new tag
git tag -a "$MAJOR_VERSION" -m "Version $MAJOR_VERSION"
fi
# Push the Git tags to GitHub
git push origin "$VERSION" --force
git push origin "$MAJOR_VERSION" --force
Loading

0 comments on commit 1eab8b8

Please sign in to comment.