Skip to content

Create release

Create release #22

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/[email protected]
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/[email protected]
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}}