Skip to content

change version of push action #11

change version of push action

change version of push action #11

Workflow file for this run

name: Release Workflow
on:
push:
branches:
- main
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '14'
- name: Get version from commit message
id: version
run: echo "::set-output name=version::$(git log -1 --pretty=%B | grep -oP 'v \K\d+\.\d+\.\d+')"
- name: Update package.json
run: |
sed -i "s/\"version\": \".*\"/\"version\": \"${{ steps.version.outputs.version }}\"/" package.json
- name: Commit changes
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add package.json
git commit -m "Bump version to ${{ steps.version.outputs.version }}"
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}
- name: Create GitHub release
uses: softprops/action-gh-release@v1
with:
files: 'dist/*'
token: ${{ secrets.GITHUB_TOKEN }}
body: |
Release ${{ steps.version.outputs.version }}