From cb5c752f8f311fc6857ca16c5a87dc748bc14213 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=91=E5=A2=A8=E6=B0=B4=E9=B1=BC?= Date: Thu, 21 Jul 2022 16:35:03 +0800 Subject: [PATCH] add github CI build.yml --- .github/workflows/build.yml | 68 +++++++++++++++++++++++++++++++++++++ Makefile | 2 +- README.md | 2 ++ 3 files changed, 71 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..4d9391d --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,68 @@ +# This is a basic workflow to help you get started with Actions + +name: CI + +# Controls when the workflow will run +on: + # Triggers the workflow on push or pull request events but only for the "master" branch + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + build-backend-linux: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-go@v3 + with: + go-version: 1.18 + - name: Build linux backend + run: | + make linux + - name: Upload linux backend + uses: actions/upload-artifact@v3 + with: + name: backend-linux + path: | + msw-open-music + config.json + build-backend-windows: + runs-on: windows-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-go@v3 + with: + go-version: 1.18 + - name: Build windows backend + run: | + go build -v + - name: Upload linux backend + uses: actions/upload-artifact@v3 + with: + name: backend-windows + path: | + msw-open-music.exe + config.json + build-frontend-web: + runs-on: ubuntu-latest + env: + CI: false + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 16 + - name: Build web front end + run: | + make web + - name: upload packaged front end + uses: actions/upload-artifact@v3 + with: + name: frontend-web + path: web/build diff --git a/Makefile b/Makefile index b9b4202..196c0c2 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -dist: +web: cd web && npm install cd web && npm run build diff --git a/README.md b/README.md index cd03626..31da864 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # MSW Open Music Project +[![CI](https://github.com/heimoshuiyu/msw-open-music/actions/workflows/build.yml/badge.svg)](https://github.com/heimoshuiyu/msw-open-music/actions/workflows/build.yml) + ## Introduction A light weight personal music streaming platform.