Release #7
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: Release | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: Released version | |
type: string | |
required: true | |
jobs: | |
show-context: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Show github context object | |
run: echo $JSON | |
env: | |
JSON: ${{ toJSON(github) }} | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Configure git | |
run: | | |
git config --global user.name "Tomohiko Ozawa" | |
git config --global user.email "[email protected]" | |
- name: Get major version | |
run: | | |
set -x | |
echo "MAJOR_VERSION=$(perl -ne 'print $1 if /^(.*?)\.(.*?)\.(.*?)$/' <<< '${{ github.event.inputs.version }}')" >> $GITHUB_ENV | |
- name: Run npm version | |
run: | | |
set -x | |
npm version ${{ inputs.version }} | |
- name: Update the major version tag | |
run: | | |
set -x | |
git tag -f v${{ env.MAJOR_VERSION }} | |
- name: Push the version commit and tags | |
run: | | |
set -x | |
git pull --rebase | |
git push origin HEAD | |
git push -f --tags |