Skip to content

Maybe release

Maybe release #28732

Workflow file for this run

name: Maybe release
on:
workflow_dispatch:
push:
branches:
- main
schedule:
- cron: '0 14 * * *'
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Read Node.js version to install from `.nvmrc`
run: echo "##[set-output name=NVMRC;]$(cat .nvmrc)"
id: nvm
- name: Install required Node.js version
uses: actions/setup-node@v2
with:
node-version: "${{ steps.nvm.outputs.NVMRC }}"
- uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- run: npm ci
- name: Generate new data
run: npm run generate
- name: Commit changes if necessary
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: "feat(data): Automatic data update"
# Optional glob pattern of files which should be added to the commit
file_pattern: raw-time-zones.json time-zones-names.json
- name: Release if necessary
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/next'
run: npx semantic-release
env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}