Autoupdate #695
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: Autoupdate | |
on: | |
schedule: | |
- cron: "0 1 * * *" | |
concurrency: | |
group: "${{ github.workflow }} @ ${{ github.ref }}" | |
cancel-in-progress: false | |
jobs: | |
update: | |
env: | |
SERVICE_ACCOUNT: ${{ secrets.SERVICE_ACCOUNT }} | |
GOOGLE_APPLICATION_CREDENTIALS: ${{ github.workspace }}/tmp/serviceAccount.json | |
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: "main" | |
- name: Set service account | |
id: set_service_account | |
run: echo $SERVICE_ACCOUNT>serviceAccount.json | |
working-directory: ${{ github.workspace }}/tmp | |
- name: Autoupdate | |
id: autoupdate | |
uses: siarheidudko/autoupdater@v3 | |
with: | |
author-email: "[email protected]" | |
author-name: "Siarhei Dudko" | |
working-directory: ${{ github.workspace }}/tmp | |
ref: ${{ github.repository }} | |
branch: "main" | |
builds-and-checks: | | |
npm test | |
debug: "true" | |
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: "main" | |
- 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 modules | |
id: install_modules | |
run: npm ci | |
- name: Build tools | |
id: build_tools | |
run: npm run build | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ env.VERSION }} | |
release_name: Release ${{ env.VERSION }} | |
body: | | |
see [CHANGELOG.md](https://github.com/siarheidudko/firebase-admin-cli/blob/main/CHANGELOG.md) | |
draft: false | |
prerelease: false | |
- name: Publish package to NPM | |
id: npm_publish | |
run: npm publish | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |