2022-02-03 12:03:38 +08:00

68 lines
1.8 KiB
YAML

# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: Node.js CI
on:
release:
types: [published]
push:
tags:
- v*
branches: [ master, actions ]
# pull_request:
# branches: [ master ]
# # Allows you to run this workflow manually from the Actions tab
# workflow_dispatch:
jobs:
build:
name: Build
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: Prepare
run: |
pwd
ls -l
chmod 777 docker/entrypoint
chmod 777 tools/*
export ACTION_MODE=true
npm uninstall node-gyp -g
npm install node-gyp nw-gyp npm -g
- name: Build
run: docker-compose up
- name: Delete unused file
run: |
sudo rm -rf cache tmp
mkdir ${{ env. name }}
sudo find -maxdepth 1 -not -name ${{ env.name }} -not -name . -exec mv {} ${{ env.name }} \;
ls -l
sudo cp -r "${{ env.name }}/package.nw/node_modules/nodegit" nodegit
sudo cp -r "${{ env.name }}/compiler" compiler
env:
name: 'release-${{ github.ref_name }}'
- name: Release
uses: fnkr/github-action-ghr@v1
if: startsWith(github.ref, 'refs/tags/')
env:
GHR_COMPRESS: xz
GHR_PATH: .
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}