-
Notifications
You must be signed in to change notification settings - Fork 1
60 lines (59 loc) · 2.31 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
52
53
54
55
56
57
58
59
60
name: Release
on:
pull_request:
push:
branches: [ main ]
jobs:
# The "build" job:
test:
name: 'Build and Test'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: 14
- name: Install dependencies
run: yarn install --frozen-lockfile
release:
name: 'Release to NPM and GitHub'
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
needs: [test]
steps:
- uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: 14
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Get version from package.json before release step
id: initversion
run: echo "::set-output name=initversion::$(npm run get-version --silent)"
- name: 'Release to NPM and GitHub'
id: release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GIT_AUTHOR_NAME: hex-bot
GIT_AUTHOR_EMAIL: [email protected]
GIT_COMMITTER_NAME: hex-bot
GIT_COMMITTER_EMAIL: [email protected]
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
run: npx semantic-release
- name: 'Get version from package.json after release step'
id: extractver
run: echo "::set-output name=extractver::$(npm run get-version --silent)"
# REMOVED FOR NOW AS NOT WORKING ON PROTECTED BRANCH
# - name: 'Create Pull Request with updated package files'
# uses: peter-evans/[email protected]
# with:
# token: ${{ secrets.GITHUB_TOKEN }}
# commit-message: 'chore(release): ${{ steps.extractver.outputs.version }}'
# committer: hex-bot <[email protected]>
# author: hex-bot <[email protected]>
# title: 'chore(release): ${{ steps.extractver.outputs.version }}'
# body: 'Version bump in package.json and package-lock.json for release [${{ steps.extractver.outputs.version }}](https://github.com/${{github.repository}}/releases/tag/v${{ steps.extractver.outputs.version }})'
# branch: version-bump/${{ steps.extractver.outputs.version }}