Skip to content

Nightly release

Nightly release #954

name: Nightly release
on:
workflow_dispatch:
schedule:
- cron: 0 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/[email protected]
with:
name: lib_dist
path: ./dist/
update-nightly-release:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Delete nightly tag
uses: dev-drprasad/[email protected]
with:
tag_name: nightly
env:
GITHUB_TOKEN: ${{ secrets.COMMIT_TOKEN }}
- name: Download build artifacts
uses: actions/[email protected]
with:
name: lib_dist
path: ./dist/
- name: Create Release Notes
run: |
chmod +x ./scripts/rz.py
./scripts/rz.py create nightly --no-changes --top=":warning: **Nightly build**: This nighly-release may contain experimental features and breaking changes."
- name: Update nightly GitHub release
uses: ncipollo/release-action@v1
with:
name: Neutralino.js nightly release
bodyFile: ./.tmprz/release_notes.md
artifacts: dist/*.*
prerelease: true
allowUpdates: true
tag: nightly
- name: Clean Release Notes
run: |
./scripts/rz.py cleanup
publish-to-npm:
needs: update-nightly-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: Check changelogs before NPM release
id: check_changelog
run: |
chmod +x ./scripts/rz.py
out=$(./scripts/rz.py check)
if [[ $out == *"ST_HAS_CHANGES"* ]]; then
echo "has_changes=true" >> "$GITHUB_OUTPUT"
fi
- name: Publish to NPM Registry
if: ${{ steps.check_changelog.outputs.has_changes == 'true' }}
run: |
vend=nightly-$(date +"%Y%m%d")
v=$(npm pkg get version | tr -d '"')-$vend
npm version $v --commit-hooks=false --git-tag-version=false
npm run build
npm publish --access=public --tag nightly
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}