Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: implement the Publish Tag workflow #11

Merged
merged 2 commits into from
Dec 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/workflows/publish-tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Publish Tag

on:
push:
branches:
- main
workflow_dispatch:

jobs:
publish-tag:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

# Get the version from version.json file and store it in the output file
- name: Get version from version.json
id: retrieve_version
run: |
new_version=$(jq -r '.version' version.json)
if [ -z "$new_version" ]; then
echo "Error: version field is empty or not found in version.json!"
exit 1
fi
echo "new_version=$new_version" >> "$GITHUB_OUTPUT"

# Create and push tag to the repository by using the version from the output file
- name: Create and push tag
run: |
new_version=${{ steps.retrieve_version.outputs.new_version }}

git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
git tag -a "$new_version" -m "Release version $new_version"
git push origin "$new_version"
Loading