-
-
Notifications
You must be signed in to change notification settings - Fork 73
111 lines (93 loc) · 2.87 KB
/
create_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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
name: Create release
on:
workflow_dispatch:
inputs:
version:
type: text
description: 'Version number Eg: 4.2.0'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '16.x'
registry-url: 'https://registry.npmjs.org'
scope: '@neutralinojs'
- name: Install and Build
run: |
npm ci
npm run build
if [ -e ./dist/neutralino.js ]; then echo "OK"; else echo "ERR"; exit 1; fi
- name: Upload Artifacts
uses: actions/upload-artifact@v2
with:
name: lib_dist
path: ./dist/
create-release:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Download Linux build artifacts
uses: actions/download-artifact@v2
with:
name: lib_dist
path: ./dist/
- name: Create Release Notes
run: |
chmod +x ./scripts/rz.py
./scripts/rz.py create ${{github.event.inputs.version}}
- name: Commit and Push Changelog
uses: EndBug/add-and-commit@v7.4.0
with:
default_author: github_actions
message: 'Update changelog for v${{github.event.inputs.version}}'
add: 'CHANGELOG.md'
tag: v${{github.event.inputs.version}}
- name: Create Branch
uses: peterjgrainger/action-create-branch@v2.0.1
with:
branch: v${{github.event.inputs.version}}
env:
GITHUB_TOKEN: ${{ secrets.COMMIT_TOKEN }}
- name: Create a GitHub release
uses: ncipollo/release-action@v1
with:
tag: v${{github.event.inputs.version}}
name: Neutralino.js v${{github.event.inputs.version}} released!
bodyFile: ./.tmprz/release_notes.md
artifacts: 'dist/*.*'
- name: Clean Release Notes
run: |
./scripts/rz.py cleanup
publish-to-npm:
needs: create-release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '16.x'
registry-url: 'https://registry.npmjs.org'
scope: '@neutralinojs'
- name: Install dependencies
run: npm ci
- name: Publish to NPM Registry
run: |
npm run build
npm publish --access=public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Send Discord Notification
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
uses: Ilshidur/action-discord@master
with:
args: |
Neutralino.js v${{github.event.inputs.version}} released 🚀
Changelog: https://github.com/neutralinojs/neutralino.js/releases/tag/v${{github.event.inputs.version}}