-
Notifications
You must be signed in to change notification settings - Fork 1k
94 lines (75 loc) · 3.23 KB
/
build-binaries.yml
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
name: Build Binaries
on:
workflow_dispatch:
pull_request:
branches:
- daniel/infisical-binary
push:
branches:
- daniel/infisical-binary
# run for standalone releases
tags:
- "infisical-standalone/v*.*.*"
defaults:
run:
working-directory: ./backend
jobs:
build-and-release:
runs-on: ubuntu-20.04
strategy:
matrix:
arch: [x64, arm64]
os: [linux, win]
include:
- os: linux
target: node18-linux
- os: win
target: node18-win
steps:
- name: Checkout code
uses: actions/checkout@v3
# - name: Extract version from tag
# id: extract_version
# run: |
# # Get the tag name
# TAG_NAME=$(git describe --tags)
# # Extract the version part
# VERSION=${TAG_NAME#infisical-standalone/v}
# echo "Extracted version is $VERSION"
# # Set the version as an output
# echo "::set-output name=version::$VERSION"
# - name: Version extration test
# run: |
# echo "The extracted version is ${{ steps.extract_version.outputs.version }}"
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 18
- name: Install pkg
run: npm install -g @yao-pkg/pkg
- name: Install dependencies (backend)
run: npm install
working-directory: ./backend
- name: Install dependencies (frontend)
run: npm install --prefix ../frontend
working-directory: ./backend
- name: Prerequisites for pkg
run: npm run binary:build
working-directory: ./backend
- name: Package into node binary
run: pkg --no-bytecode --public-packages "*" --public --compress=Brotli --target ${{ matrix.target }}-${{ matrix.arch }} --output ./binary/infisical-${{ matrix.os }}-${{ matrix.arch }} .
working-directory: ./backend
- name: List files
run: ls -la ./binary
- uses: actions/setup-python@v4
- run: pip install --upgrade cloudsmith-cli
- name: Publish to Cloudsmith (Linux)
if: matrix.os == 'linux'
run: cloudsmith push raw infisical/infisical-standalone backend/binary/infisical-${{ matrix.os }}-${{ matrix.arch }} --republish --no-wait-for-sync --version 0.0.3 --api-key ${{ secrets.CLOUDSMITH_API_KEY }}
env:
CLOUDSMITH_API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }}
- name: Publish to Cloudsmith (Windows)
if: matrix.os == 'win'
run: cloudsmith push raw infisical/infisical-standalone backend/binary/infisical-${{ matrix.os }}-${{ matrix.arch }}.exe --republish --no-wait-for-sync --version 0.0.3 --api-key ${{ secrets.CLOUDSMITH_API_KEY }}
env:
CLOUDSMITH_API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }}