Skip to content

Defold Stable Releases #1875

Defold Stable Releases

Defold Stable Releases #1875

Workflow file for this run

name: Defold Stable Releases
on:
schedule:
- cron: '0 7,19 * * *'
workflow_dispatch:
jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: 'Checkout'
uses: actions/checkout@v2
- name: 'Setup Node'
uses: actions/setup-node@v1
with:
node-version: '16.x'
registry-url: 'https://registry.npmjs.org'
scope: '@ts-defold'
- name: 'Fetch Defold Version'
id: defold
uses: actionsflow/axios@v1
with:
url: http://d.defold.com/stable/info.json
- run: echo TARGET_VERSION='${{ steps.defold.outputs.data }}' >> $GITHUB_ENV
- run: echo CURRENT_VERSION=$(sed -nr 's/^\/\/ DEFOLD\. ([A-Za-z]+) version ([0-9\.]+) \(([a-z0-9]+)\)/{"version":"\2","sha1":"\3"}/p' './index.d.ts') >> $GITHUB_ENV
- name: 'Update Types'
if: ${{ env.TARGET_VERSION != env.CURRENT_VERSION }}
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
npm ci
npm run build
npm run check
git add --all
git commit -m "Defold Release" -m '${{ steps.defold.outputs.data }}'
npm version patch
npm publish --access public
git push
git push --tags
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}