Skip to content

Commit

Permalink
Merge pull request #10 from jannis-baum/issue/6-distribute
Browse files Browse the repository at this point in the history
Distribute
  • Loading branch information
jannis-baum authored Jul 25, 2023
2 parents 633b950 + ddd042e commit 94e095d
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 6 deletions.
23 changes: 20 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name: CI

on: push

permissions:
contents: write

jobs:
lint:
name: Lint
Expand All @@ -16,6 +19,20 @@ jobs:
needs: [lint]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: yarn
- run: yarn build
- name: checkout
uses: actions/checkout@v3
- name: build
run: |
yarn
yarn build
- name: package
if: startsWith(github.ref, 'refs/tags/v')
run: |
zip -r vivify-macos-${{ github.ref_name }}.zip bin/macos/*
zip -r vivify-linux-${{ github.ref_name }}.zip bin/linux/*
- name: release
if: startsWith(github.ref, 'refs/tags/v')
uses: softprops/action-gh-release@v1
with:
generate_release_notes: true
files: vivify-*.zip
17 changes: 17 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/sh

cd `dirname $0`

rm -rf bin

node_modules/.bin/tsc --project . \
&& node_modules/.bin/pkg . \
|| exit 1

mkdir bin/macos
mv bin/vivify-server-macos bin/macos/vivify-server
cp viv bin/macos/viv

mkdir bin/linux
mv bin/vivify-server-linux bin/linux/vivify-server
cp viv bin/linux/viv
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
{
"name": "vivify-server",
"version": "0.0.1",
"repository": "https://github.com/jannis-baum/vivify.git",
"author": "Jannis Baum",
"scripts": {
"dev-prog": "VIV_CMD='./node_modules/.bin/ts-node ./src/app.ts' ./viv",
"dev": "VIV_TIMEOUT=0 nodemon --exec ts-node ./src/app.ts",
"build": "tsc --project . && pkg .",
"build": "./build.sh",
"lint": "eslint src static"
},
"bin": "dist/app.js",
"pkg": {
"scripts": "dist/**/*.js",
"assets": "static/**/*",
"targets": [
"latest-macos-arm64"
"latest-macos", "latest-linux"
],
"outputPath": "bin"
},
Expand Down
22 changes: 22 additions & 0 deletions release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash

if [ "$1" != "minor" -a "$1" != "major" ]; then
echo "Specify increment minor|major."
exit 1
fi

version="v0.0.0"
prev=$(git tag --sort=version:refname | tail -1)

if [ -n "$prev" ]; then
prefix=$(cut -d. -f1 <<< $prev)
major=$(cut -d. -f2 <<< $prev)

[ "$1" = "minor" ] && minor=$(bc <<< "$(cut -d. -f3 <<< $prev) + 1")
[ "$1" = "major" ] && major=$(bc <<< "$major + 1") && minor="0"

version="$prefix.$major.$minor"
fi

git tag -s -a $version
git push origin $version

0 comments on commit 94e095d

Please sign in to comment.