Merge 2 workflows into one
This commit is contained in:
@@ -1,30 +0,0 @@
|
||||
name: Build
|
||||
|
||||
on:
|
||||
push: {}
|
||||
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
working-directory: .
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu
|
||||
container:
|
||||
image: node:20
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Install tools
|
||||
run: apt update && apt install -y build-essential
|
||||
|
||||
- name: Compile project
|
||||
run: make
|
||||
|
||||
- name: Save build output
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: ncsambawatcher
|
||||
path: ./ncsambawatcher
|
||||
@@ -1,25 +1,48 @@
|
||||
name: Release
|
||||
name: CI
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- v.*
|
||||
- '*' # Triggers on all tags
|
||||
branches:
|
||||
- '**' # Triggers on all branches
|
||||
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
working-directory: .
|
||||
|
||||
jobs:
|
||||
release:
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu
|
||||
container:
|
||||
image: node:20
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Install tools
|
||||
run: apt update && apt install -y build-essential
|
||||
|
||||
- name: Compile project
|
||||
run: make
|
||||
|
||||
- name: Save build output
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: ncsambawatcher
|
||||
path: ./ncsambawatcher
|
||||
|
||||
release:
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
needs: build
|
||||
runs-on: ubuntu
|
||||
container:
|
||||
image: node:20
|
||||
steps:
|
||||
- name: Install build tools
|
||||
run: apt update && apt install -y zip
|
||||
|
||||
|
||||
- name: Download compiled binary
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
@@ -30,7 +53,8 @@ jobs:
|
||||
mkdir build
|
||||
cp ncsambawatcher build/ncsambawatcher
|
||||
cp configs/ncsambawatcher.config.default build/ncsambawatcher.config
|
||||
cp init.sh config/init.sh
|
||||
cp configs/ncsambawatcher.service.default build/ncsambawatcher.service
|
||||
cp init.sh build/init.sh
|
||||
|
||||
- name: Create release zip
|
||||
run: |
|
||||
Reference in New Issue
Block a user