-
Notifications
You must be signed in to change notification settings - Fork 1
55 lines (54 loc) · 1.76 KB
/
gitpublish.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
49
50
51
52
53
54
55
name: Publish Tag
on:
push:
branches:
- Stable
jobs:
job1:
name: Publish Tag
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- id: set_var
name: Get Version
run: |
content=`cat ./package.json`
# the following lines are only required for multi line json
content="${content//'%'/'%25'}"
content="${content//$'\n'/'%0A'}"
content="${content//$'\r'/'%0D'}"
# end of optional handling for multi line json
echo "::set-output name=packageJson::$content"
- name: Push Tag
id: tag
uses: anothrNick/github-tag-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
WITH_V: true
CUSTOM_TAG: "v${{ fromJson(steps.set_var.outputs.packageJson).version }}"
job2:
needs: job1
name: Publish Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- id: set_var
name: Get Version
run: |
content=`cat ./package.json`
# the following lines are only required for multi line json
content="${content//'%'/'%25'}"
content="${content//$'\n'/'%0A'}"
content="${content//$'\r'/'%0D'}"
# end of optional handling for multi line json
echo "::set-output name=packageJson::$content"
- name: Echo Debug
run: |
echo "${{ fromJson(steps.set_var.outputs.packageJson).version }}"
- name: Create GitHub release
uses: Roang-zero1/github-create-release-action@master
with:
prerelease_regex: ^v[0-9]\.[0-9]\.[0-9]\-
created_tag: v${{ fromJson(steps.set_var.outputs.packageJson).version }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}