-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (49 loc) · 2.15 KB
/
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
42
43
44
45
46
47
48
49
50
51
name: Release
on:
push:
branches:
- main
jobs:
release:
name: 'Release GitHub'
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: 14
- name: Install dependencies
run: npm ci
- name: Get version from package.json before the release step
id: pre_release_version
run: echo "::set-output name=version::$(npm run get-version --silent)"
- name: Update manifest.json and package.json and release to GitHub
id: release
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GIT_AUTHOR_NAME: ops-bot
GITAUTHOR_EMAIL: [email protected]
GIT_COMMITTER_NAME: ops-bot
GIT_COMMITTER_EMAIL: [email protected]
run: npm run release
- name: Get version from package.json after release step
id: post_release_version
run: echo "::set-output name=version::$(npm run get-version --silent)"
- name: debugging pre and post versions
id: my-debug
run: echo "${{ steps.pre_release_version.outputs.version }} and ${{ steps.post_release_version.outputs.version }}"
- name: Create Pull Request with updated package files
if: steps.pre_release_version.outputs.version != steps.post_release_version.outputs.version
uses: peter-evans/[email protected]
with:
token: ${{ secrets.GH_TOKEN }}
commit-message: 'chore(release): ${{ steps.post_release_version.outputs.version }}'
committer: ops-bot <[email protected]>
labels: automerge
author: ops-bot <[email protected]>
title: 'chore(release): ${{ steps.post_release_version.outputs.version }}'
body: 'Bump version in manifest.json, package.json and package-lock.json for [${{ steps.post_release_version.outputs.version }}](https://github.com/${{github.repository}}/releases/tag/v${{ steps.post_release_version.outputs.version }}) release'
branch: version-bump/${{ steps.post_release_version.outputs.version }}