generated from actions/typescript-action
-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (39 loc) · 1.28 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
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 }}