Create release #27
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Create release | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
type: text | |
description: 'Version number Eg: 4.2.0' | |
jobs: | |
create-release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- uses: actions/setup-node@v2 | |
with: | |
node-version: '16.x' | |
registry-url: 'https://registry.npmjs.org' | |
scope: '@neutralinojs' | |
- name: Configure | |
run: | | |
npm ci | |
- 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@v3.0.0 | |
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: Neutralinojs CLI v${{github.event.inputs.version}} released! | |
bodyFile: ./.tmprz/release_notes.md | |
- name: Publish to NPM Registry | |
run: | | |
npm publish --access=public | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: Clean Release Notes | |
run: | | |
./scripts/rz.py cleanup | |
- name: Send Discord Notification | |
env: | |
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} | |
uses: Ilshidur/action-discord@master | |
with: | |
args: | | |
Neutralinojs CLI v${{github.event.inputs.version}} released 🚀 | |
Changelog: https://github.com/neutralinojs/neutralinojs-cli/releases/tag/v${{github.event.inputs.version}} | |