Skip to content

にゅーすたいる (#33) #24

にゅーすたいる (#33)

にゅーすたいる (#33) #24

Workflow file for this run

name: Create tag
on:
push:
branches:
- production
jobs:
create-tag:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Get package version
id: package-version
run: echo "::set-output name=version::$(node -p -e "require('./package.json').version")"
- name: Get tag version and compare versions
id: tag-version
run: |
echo "::set-output name=tag::$(git describe --tags --abbrev=0)"
version=$(node -p -e "require('./package.json').version")
tag=$(git describe --tags --abbrev=0)
if [[ $version == $tag ]]; then
echo "::set-output name=compare::true"
else
echo "::set-output name=compare::false"
fi
- name: Create tag if versions have upgraded
if: steps.tag-version.outputs.compare == 'false'
run: |
git config --local user.name "github-actions"
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git tag -a ${{ steps.package-version.outputs.version }} -m "Production release ${{ steps.package-version.outputs.version }}"
git push --follow-tags