Skip to content

Commit

Permalink
chore: updater
Browse files Browse the repository at this point in the history
  • Loading branch information
lencx committed Oct 3, 2022
1 parent f5eab44 commit f0537a1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
9 changes: 1 addition & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,17 +99,10 @@ jobs:

steps:
- uses: actions/checkout@v2

- name: Setup node
uses: actions/setup-node@v1
with:
node-version: 16
- run: yarn add -D node-fetch @actions/github
- run: yarn
- run: yarn updater
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# refs/tags/v0.0.0 -> 0.0.0
TAG: ${GITHUB_REF:11}

- name: Deploy install.json
uses: peaceiris/actions-gh-pages@v3
Expand Down
5 changes: 2 additions & 3 deletions scripts/updater.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import fs from 'fs';
import { resolveUpdateLog } from './updatelog.mjs';

const token = process.env.GITHUB_TOKEN;
const version = process.env.TAG || '0.0.0';

async function updater() {
if (!token) {
Expand Down Expand Up @@ -33,10 +32,9 @@ async function updater() {
});

const updateData = {
name: tag.name,
version: tag.name,
notes: resolveUpdateLog(tag.name), // use UPDATE_LOG.md
pub_date: new Date().toISOString(),
version,
platforms: {
win64: { signature: '', url: '' }, // compatible with older formats
linux: { signature: '', url: '' }, // compatible with older formats
Expand Down Expand Up @@ -82,6 +80,7 @@ async function updater() {
await setAsset(asset, /.AppImage.tar.gz/, ['linux', 'linux-x86_64']);
});
await Promise.allSettled(promises);

if (!fs.existsSync('updater')) {
fs.mkdirSync('updater');
}
Expand Down

0 comments on commit f0537a1

Please sign in to comment.