Skip to content

Autoupdate

Autoupdate #5

Workflow file for this run

name: Autoupdate
on:
schedule:
- cron: "0 1 * * *"
concurrency:
group: "${{ github.workflow }} @ ${{ github.ref }}"
cancel-in-progress: false
jobs:
update:
runs-on: ubuntu-latest
timeout-minutes: 10
outputs:
updated: ${{ steps.autoupdate.outputs.updated }}
version: ${{ steps.autoupdate.outputs.version }}
steps:
- name: Сheckout repo
id: checkout_repo
uses: actions/checkout@v4
with:
path: "tmp"
ref: "master"
- name: Autoupdate
id: autoupdate
uses: siarheidudko/autoupdater@v3
with:
author-email: "slavianich@gmail.com"
author-name: "Siarhei Dudko"
working-directory: ${{ github.workspace }}/tmp
ref: ${{ github.repository }}
branch: "master"
builds-and-checks: |
npm run lint
npm run build
npm test
debug: "true"
ignore-packages: |
@types/node
release:
runs-on: ubuntu-latest
timeout-minutes: 15
env:
NODE_VERSION: 22
VERSION: ${{ needs.update.outputs.version }}
needs: [update]
if: ${{ needs.update.outputs.updated == 'true' }}
steps:
- name: Сheckout repo
id: checkout_repo
uses: actions/checkout@v4
with:
ref: "master"
- name: Use Node.js ${{ env.NODE_VERSION }}
id: setup_node
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
registry-url: "https://registry.npmjs.org"
- name: Cache node modules
id: use_cache
uses: actions/cache@v4
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install dependencies
id: install_ci
run: npm ci
- name: Build package
id: build_package
run: npm run build
- name: Create Release
id: create_release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.ref }}
name: v${{ needs.update.outputs.version }}
body_path: ${{ github.workspace }}/README.md
repository: dudko-dev/protoobject
token: ${{ secrets.TOKEN_FOR_WORKFLOW }}
draft: false
prerelease: false
- name: Publish package to NPM
id: npm_publish
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}