From e8d50ddff42e5e06d9d208b3fa6e8f7088c939a6 Mon Sep 17 00:00:00 2001 From: hmqgg Date: Sun, 28 Mar 2021 17:50:25 +0800 Subject: [PATCH] Nightly Release on develop branch --- .github/workflows/nightly-version.js | 5 ++++ .github/workflows/nighty_release.yml | 36 ++++++++++++++++++++++++++++ module_nightly.json | 29 ++++++++++++++++++++++ 3 files changed, 70 insertions(+) create mode 100644 .github/workflows/nightly-version.js create mode 100644 .github/workflows/nighty_release.yml create mode 100644 module_nightly.json diff --git a/.github/workflows/nightly-version.js b/.github/workflows/nightly-version.js new file mode 100644 index 0000000..b440763 --- /dev/null +++ b/.github/workflows/nightly-version.js @@ -0,0 +1,5 @@ +var fs = require('fs'); +let date = new Date(); +let json = JSON.parse(fs.readFileSync('./module_nightly.json', 'utf8')); +json.version = `${date.getUTCFullYear()}.${date.getUTCMonth() + 1}.${date.getUTCDate()}.${date.getUTCHours()}.${date.getUTCMinutes()}.${date.getUTCSeconds()}`; +fs.writeFileSync('./module.json', JSON.stringify(json)); \ No newline at end of file diff --git a/.github/workflows/nighty_release.yml b/.github/workflows/nighty_release.yml new file mode 100644 index 0000000..c644f3a --- /dev/null +++ b/.github/workflows/nighty_release.yml @@ -0,0 +1,36 @@ +name: Nightly Release + +on: + push: + branches: + - develop + +jobs: + build: + name: Upload Release Asset + runs-on: ubuntu-latest + steps: + - name: Checkout code + id: checkout + uses: actions/checkout@v2 + - name: Overwrite Manifest + id: nightly-version + shell: bash + run: node ./.github/workflows/nightly-version.js + - name: Build project + id: build-zip + run: | + zip -r bililive.zip module.json bililive.js lang/ modules/ + + - name: Nightly Release + id: nightly_release + uses: ncipollo/release-action@v1 + if: endsWith(github.ref, 'develop') + with: + name: nightly + tag: nightly + allowUpdates: true + replacesArtifacts: true + artifacts: 'module.json,bililive.zip' + token: ${{ secrets.GITHUB_TOKEN }} + diff --git a/module_nightly.json b/module_nightly.json new file mode 100644 index 0000000..1052859 --- /dev/null +++ b/module_nightly.json @@ -0,0 +1,29 @@ +{ + "name": "bililive", + "title": "Bilibili Live Danmaku", + "description": "【FVTT-CN/hmqgg 开发】整合 Bilibili 直播间弹幕到 FVTT OOC 聊天中。\nIntegrate Bilibili Live Room Danmaku into Foundry VTT OOC Chat Logs.", + "author": "hmqgg [FVTT-CN]", + "version": "2021.3.28.10.0.0", + "minimumCoreVersion": "0.7.9", + "compatibleCoreVersion": "0.7.9", + "esmodules": [ + "./bililive.js", + "./modules/danmaku.js" + ], + "languages": [ + { + "lang": "en", + "name": "English", + "path": "/lang/en.json" + }, + { + "lang": "cn", + "name": "中文", + "path": "/lang/cn.json" + } + ], + "url": "https://github.com/fvtt-cn/FoundryVTT-BiliLive-Danmaku", + "changelog": "https://github.com/fvtt-cn/FoundryVTT-BiliLive-Danmaku/blob/main/CHANGELOG.md", + "manifest": "https://github.com/fvtt-cn/FoundryVTT-BiliLive-Danmaku/releases/download/nightly/module.json", + "download": "https://github.com/fvtt-cn/FoundryVTT-BiliLive-Danmaku/releases/download/nightly/bililive.zip" +} \ No newline at end of file