-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (46 loc) · 1.56 KB
/
create-release.yaml
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
49
50
51
52
53
54
55
56
name: Create Release
on:
repository_dispatch:
types: [create-tag-release]
jobs:
create_release:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '16'
- name: Install jq
run: sudo apt-get install -y jq
- name: Get version from package.json
id: get_version
run: |
VERSION=$(jq -r '.version' package.json)
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Setup Git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- name: Create tag
run: |
git tag -a "v${{ env.VERSION }}" -m "Release v${{ env.VERSION }}"
git push https://${{ secrets.ACTIONS_PAT }}@github.com/${{ github.repository }}.git "v${{ env.VERSION }}"
- name: Create GitHub Release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: 'v${{ env.VERSION }}'
release_name: 'v${{ env.VERSION }}'
body: |
## Changes
$(git log --oneline $(git describe --tags --abbrev=0)..HEAD)
draft: false
prerelease: false
- name: Trigger Release components package workflow
uses: peter-evans/repository-dispatch@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
event-type: create-npm-package