Skip to content

Commit ada7e38

Browse files
authored
Merge pull request #16 from mareklibra/release.yaml
GitHub workflow: release.yaml
2 parents adb57a2 + 9f19d4c commit ada7e38

File tree

1 file changed

+25
-6
lines changed

1 file changed

+25
-6
lines changed

.github/workflows/release.yaml

+25-6
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,44 @@ on:
55
tags:
66
- '*'
77

8+
# Following is for testing only:
9+
#on:
10+
# pull_request:
11+
# branches:
12+
# - master
13+
814
jobs:
915
build:
1016
runs-on: ubuntu-latest
1117
steps:
18+
# expected format of the new git tag: v1.2.3
19+
- name: Get tag
20+
id: get_tag
21+
# TODO: use GIT TAG!!! run: echo ::set-env name=GIT_TAG::${GITHUB_REF#refs/tags/}
22+
run: echo ::set-env name=VERSION::$(echo ${GITHUB_REF#refs/tags/} | sed -e 's/^v//g')
1223
- uses: actions/checkout@v2
13-
# Setup .npmrc file to publish to npm
24+
with:
25+
fetch-depth: 0
26+
ref: master
1427
- uses: actions/setup-node@v1
1528
with:
1629
node-version: '12.x'
1730
registry-url: 'https://registry.npmjs.org'
31+
- run: |
32+
git config user.name 'GitHub action executed on release'
33+
git config user.email 'github@users.noreply.github.com'
1834
- run: yarn install
19-
# expected format of the new git tag: 1.2.3
20-
# TODO: remove optional 'v' from beginning of the tag name
21-
- run: yarn publish --new-version ${GITHUB_REF#refs/tags/}
35+
- run: yarn publish --new-version ${{ env.VERSION }}
2236
env:
2337
NODE_AUTH_TOKEN: ${{ secrets.NPMJS_PUBLISH_TOKEN }}
2438
- name: Create Pull Request
2539
uses: peter-evans/create-pull-request@v2
2640
with:
27-
committer: GitHub <noreply@github.com>
28-
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
41+
token: ${{ secrets.GITHUB_TOKEN }}
42+
title: Autogenerated new version ${{ env.VERSION }}
43+
base: master
44+
commit-message: Add dummy file
45+
committer: GitHub action executed on release <noreply@github.com>
46+
author: GitHub action executed on release <noreply@github.com>
47+
2948

0 commit comments

Comments
 (0)