2023-05-26 11:20:52 +00:00
|
|
|
on:
|
2023-05-28 12:18:05 +00:00
|
|
|
- push
|
|
|
|
- workflow-call
|
2023-05-26 11:20:52 +00:00
|
|
|
|
2023-05-28 12:37:20 +00:00
|
|
|
env:
|
|
|
|
ACTIONS_STEP_DEBUG: true
|
|
|
|
|
2023-05-26 11:20:52 +00:00
|
|
|
jobs:
|
|
|
|
build-glibc:
|
|
|
|
name: Build backend-glibc
|
2023-05-26 11:30:34 +00:00
|
|
|
runs-on: 'docker'
|
2023-05-26 11:20:52 +00:00
|
|
|
container:
|
|
|
|
image: rust:bullseye
|
|
|
|
steps:
|
2023-05-28 12:31:07 +00:00
|
|
|
- run: apt-get update
|
2023-05-28 12:29:08 +00:00
|
|
|
- run: apt-get install git nodejs -y
|
2023-05-26 11:20:52 +00:00
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Build
|
|
|
|
run: cargo build --release
|
|
|
|
working-directory: backend
|
|
|
|
- name: Upload executable
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
with:
|
|
|
|
name: backend-glibc
|
|
|
|
path: backend/target/release/backend_rust
|
|
|
|
build-muslc:
|
|
|
|
name: Build backend-muslc
|
2023-05-26 11:30:34 +00:00
|
|
|
runs-on: 'docker'
|
2023-05-28 12:20:30 +00:00
|
|
|
container:
|
2023-05-26 11:20:52 +00:00
|
|
|
image: rust:alpine
|
|
|
|
steps:
|
|
|
|
- name: Install dependencies
|
2023-05-28 12:29:08 +00:00
|
|
|
run: apk add pkgconf musl-dev git nodejs
|
2023-05-28 12:20:30 +00:00
|
|
|
- uses: actions/checkout@v3
|
2023-05-26 11:20:52 +00:00
|
|
|
- name: Build
|
|
|
|
run: cargo build --release
|
|
|
|
working-directory: backend
|
|
|
|
- name: Upload executable
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
with:
|
|
|
|
name: backend-muslc
|
|
|
|
path: backend/target/release/backend_rust
|
|
|
|
build-frontend:
|
|
|
|
name: Build frontend
|
2023-05-26 11:30:34 +00:00
|
|
|
runs-on: 'docker'
|
2023-05-26 11:20:52 +00:00
|
|
|
container:
|
|
|
|
image: node:current-alpine
|
|
|
|
steps:
|
2023-05-28 13:15:50 +00:00
|
|
|
- run: apk add git tar
|
2023-05-26 11:20:52 +00:00
|
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Install packages
|
|
|
|
run: yarn install --frozen-lockfile
|
|
|
|
working-directory: frontend
|
|
|
|
- name: Lint
|
|
|
|
run: yarn lint
|
|
|
|
working-directory: frontend
|
|
|
|
- name: Build
|
|
|
|
run: yarn build
|
|
|
|
working-directory: frontend
|
2023-05-28 13:15:50 +00:00
|
|
|
- run: tar -cf ../frontend.tar *
|
|
|
|
working-directory: frontend/dist
|
2023-05-26 11:20:52 +00:00
|
|
|
- name: Upload frontend
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
with:
|
2023-05-28 13:15:50 +00:00
|
|
|
name: frontend.tar
|
|
|
|
path: frontend/frontend.tar
|
2023-05-26 11:20:52 +00:00
|
|
|
package:
|
|
|
|
name: Package builds
|
2023-05-26 11:30:34 +00:00
|
|
|
runs-on: 'docker'
|
2023-05-26 11:20:52 +00:00
|
|
|
container:
|
2023-05-28 13:01:07 +00:00
|
|
|
image: node:current-alpine
|
2023-05-26 11:20:52 +00:00
|
|
|
needs: [build-glibc, build-muslc, build-frontend]
|
|
|
|
steps:
|
|
|
|
- name: Install packages
|
|
|
|
run: apk add tar xz
|
|
|
|
- run: mkdir static
|
|
|
|
- name: Download frontend
|
2023-05-28 13:01:07 +00:00
|
|
|
uses: https://github.com/actions/download-artifact@v3
|
2023-05-26 11:20:52 +00:00
|
|
|
with:
|
2023-05-28 13:15:50 +00:00
|
|
|
name: frontend.tar
|
|
|
|
path: static/frontend.tar
|
|
|
|
- run: tar -xf frontend.tar && rm frontend.tar
|
|
|
|
working-directory: static
|
2023-05-26 11:20:52 +00:00
|
|
|
- name: Download backend-glibc
|
2023-05-28 13:01:07 +00:00
|
|
|
uses: https://github.com/actions/download-artifact@v3
|
2023-05-26 11:20:52 +00:00
|
|
|
with:
|
|
|
|
name: backend-glibc
|
|
|
|
path: server
|
|
|
|
- name: Package backend-glibc
|
|
|
|
run: tar -cvJf linux-x64-glibc.tar.xz server static
|
|
|
|
- name: Upload package-glibc
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
with:
|
2023-05-28 13:15:50 +00:00
|
|
|
name: linux-x64-glibc.tar.xz
|
2023-05-26 11:20:52 +00:00
|
|
|
path: linux-x64-glibc.tar.xz
|
|
|
|
- name: Download backend-muslc
|
2023-05-28 13:01:07 +00:00
|
|
|
uses: https://github.com/actions/download-artifact@v3
|
2023-05-26 11:20:52 +00:00
|
|
|
with:
|
|
|
|
name: backend-muslc
|
|
|
|
path: server
|
|
|
|
- name: Package backend-muslc
|
|
|
|
run: tar -cvJf linux-x64-muslc.tar.xz server static
|
|
|
|
- name: Upload package-muslc
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
with:
|
2023-05-28 13:15:50 +00:00
|
|
|
name: linux-x64-muslc.tar.xz
|
2023-05-26 11:20:52 +00:00
|
|
|
path: linux-x64-muslc.tar.xz
|