forked from safe-global/safe-wallet-web
-
Notifications
You must be signed in to change notification settings - Fork 5
41 lines (36 loc) · 1.1 KB
/
tag-release.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
name: Tag & GitHub release
on:
pull_request_target:
branches:
- main
types: [closed]
jobs:
tag-release:
runs-on: ubuntu-latest
steps:
- name: Checkout
if: github.event.pull_request.merged == true
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Extract version
if: github.event.pull_request.merged == true
id: version
run: |
NEW_VERSION=$(node -p 'require("./package.json").version')
echo "version=v$NEW_VERSION" >> $GITHUB_OUTPUT
- name: Create a git tag
if: github.event.pull_request.merged == true
run: git tag ${{ steps.version.outputs.version }} && git push --tags
- name: GitHub release
if: success()
uses: softprops/action-gh-release@v1
id: create_release
with:
draft: true
prerelease: false
name: ${{ steps.version.outputs.version }}
tag_name: ${{ steps.version.outputs.version }}
body: ${{ github.event.pull_request.body }}
env:
GITHUB_TOKEN: ${{ github.token }}