2023-10-07 03:51:31 +00:00
|
|
|
name: Publish prebuild
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- stable
|
|
|
|
release:
|
|
|
|
types: [published]
|
|
|
|
workflow_dispatch:
|
|
|
|
|
|
|
|
jobs:
|
2023-10-07 13:00:39 +00:00
|
|
|
build_binaries:
|
|
|
|
name: Build & ship binaries
|
2023-10-07 03:51:31 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
node-version: [20.x]
|
|
|
|
python-version: [3.11.x]
|
|
|
|
if: github.repository == 'transfem-org/Sharkey'
|
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
packages: write
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Check out the repo
|
2023-10-18 12:37:13 +00:00
|
|
|
uses: actions/checkout@v4.1.1
|
2023-10-07 13:16:36 +00:00
|
|
|
with:
|
|
|
|
lfs: true
|
|
|
|
submodules: 'recursive'
|
2023-10-07 03:51:31 +00:00
|
|
|
|
|
|
|
- name: Use Node.js ${{ matrix.node-version }}
|
2023-10-24 13:05:03 +00:00
|
|
|
uses: actions/setup-node@v4
|
2023-10-07 03:51:31 +00:00
|
|
|
with:
|
|
|
|
node-version: ${{ matrix.node-version }}
|
|
|
|
|
|
|
|
- name: Setup Python
|
2023-12-06 12:36:44 +00:00
|
|
|
uses: actions/setup-python@v5.0.0
|
2023-10-07 03:51:31 +00:00
|
|
|
with:
|
|
|
|
python-version: ${{ matrix.python-version }}
|
|
|
|
|
|
|
|
- name: Cache APT Packages
|
2023-10-31 12:53:43 +00:00
|
|
|
uses: awalsh128/cache-apt-pkgs-action@v1.3.1
|
2023-10-07 03:51:31 +00:00
|
|
|
with:
|
2023-10-07 13:42:39 +00:00
|
|
|
packages: "build-essential binfmt-support qemu-user-static ffmpeg tini curl libjemalloc-dev libjemalloc2 uuid-dev libx11-dev libxkbfile-dev execstack libgconf-2-4 libsecret-1-dev"
|
2023-10-07 03:51:31 +00:00
|
|
|
|
2023-10-08 18:20:14 +00:00
|
|
|
- name: Set pnpm store path
|
|
|
|
run: echo "PNPM_STORE_PATH=$(pnpm store path)" >> $GITHUB_ENV
|
|
|
|
|
2023-10-07 03:51:31 +00:00
|
|
|
- name: Cache node modules
|
|
|
|
uses: actions/cache@v3
|
|
|
|
with:
|
2023-10-08 18:20:14 +00:00
|
|
|
path: ${{ env.PNPM_STORE_PATH }}
|
|
|
|
key: pnpm-${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}
|
|
|
|
restore-keys: |
|
|
|
|
pnpm-${{ runner.os }}-
|
2023-10-07 13:42:39 +00:00
|
|
|
|
2023-10-07 03:51:31 +00:00
|
|
|
- name: Build
|
|
|
|
run: |
|
2023-10-07 13:00:39 +00:00
|
|
|
corepack enable
|
|
|
|
corepack prepare pnpm@latest --activate
|
2023-10-08 18:20:14 +00:00
|
|
|
CI=true pnpm install
|
|
|
|
CI=true pnpm run build
|
|
|
|
rm -rdf packages/backend/node_modules
|
|
|
|
rm -rdf packages/frontend/node_modules
|
|
|
|
rm -rdf packages/megalodon/node_modules
|
|
|
|
rm -rdf packages/misskey-js/node_modules
|
|
|
|
rm -rdf node_modules
|
|
|
|
CI=true pnpm --prod --no-optional install
|
|
|
|
tar -czf /tmp/workspace.tar.gz .
|
2023-10-07 15:01:20 +00:00
|
|
|
- name: Upload linux x64
|
|
|
|
uses: actions/upload-artifact@v3.1.3
|
|
|
|
with:
|
|
|
|
name: sharkey-linux-x64
|
2023-10-08 18:20:14 +00:00
|
|
|
path: /tmp/workspace.tar.gz
|