-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (53 loc) · 1.57 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
61
62
63
64
65
name: Release and Deploy
on:
workflow_dispatch:
inputs:
version-component:
description: 'Version component to increment (major, minor, or patch)'
required: true
default: 'patch'
type: choice
options:
- major
- minor
- patch
permissions:
contents: write
jobs:
release_and_deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: 16
cache: 'npm'
- name: Set git config
run: |
git config --global user.email 'cormoran707@gmail.com'
git config --global user.name 'cormoran'
- name: Install dependencies
run: npm install
- name: Set version to env
run: echo "VERSION=$(node -p -e "require('./package.json').version")" >> $GITHUB_ENV
- name: Build
run: npm run build
- name: Create release
uses: softprops/action-gh-release@v1
with:
tag_name: v${{ env.VERSION }}
files: |
dist/power-mf-me.user.js
dist/power-mf-me.meta.js
generate_release_notes: true
- name: Increment Version in package.json
run: npm version ${{ github.event.inputs.version-component }} -m "Bump version to %s"
- name: Push changes to main
run: git push origin main
- name: Check failure status
if: failure()
run: |
git status
cat /home/runner/.npm/_logs/*