summaryrefslogtreecommitdiff
path: root/.github/workflows/package.yml
blob: f0972893fc960db6eddfcf1d729056f52fb9f263 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: Publish prebuild

on:
  push:
    branches:
      - stable
    paths:
      - packages/**
      - locales/**
  release:
    types: [published]
  workflow_dispatch:

jobs:
  build_binaries:
    name: Build & ship binaries
    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
        uses: actions/checkout@v4.1.0
        with:
          lfs: true
          submodules: 'recursive'
        
      - name: Use Node.js ${{ matrix.node-version }}
        uses: actions/setup-node@v3
        with:
          node-version: ${{ matrix.node-version }}

      - name: Setup Python
        uses: actions/setup-python@v4.7.1
        with:
          python-version: ${{ matrix.python-version }}

      - name: Cache APT Packages
        uses: awalsh128/cache-apt-pkgs-action@v1.3.0
        with:
          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"

      - name: Cache node modules
        uses: actions/cache@v3
        with:
          path: ~/.npm
          key: v1-npm-deps-${{ hashFiles('**/package-lock.json') }}
          restore-keys: v1-npm-deps-

      - uses: MOZGIII/install-ldid-action@v1
        with:
          tag: v2.1.5-procursus2

      - name: Build
        run: |
          corepack enable
          corepack prepare pnpm@latest --activate
          pnpm install
          npm install -g pkg
          pnpm run build
          cd packages/backend
          pkg --debug --public ./built/boot/entry.js --targets latest-linuxstatic-x64,latest-linuxstatic-arm64,latest-macos-x64,latest-macos-arm64,latest-win-x64
          ls