Skip to content
This repository was archived by the owner on Aug 23, 2025. It is now read-only.

Commit fd236ee

Browse files
authored
Add a build pipeline (#550)
* Add build pipeline * Fixed build * Revert build script bach to sh and fix the [[ ]] unknown syntac * Use Actions major version
1 parent 797c26f commit fd236ee

4 files changed

Lines changed: 56 additions & 5 deletions

File tree

.github/workflows/build.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/usr/bin/env sh
2+
set -x
3+
4+
apt-get update
5+
apt-get install -y --no-install-recommends g++ make python3 python3-setuptools unixodbc-dev
6+
7+
bash -x scripts/build.sh
8+
9+
tar -cavf sqlpad.tar.gz -C server/public .

.github/workflows/main.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: SQLPad release
2+
3+
on:
4+
push:
5+
tags:
6+
- "*"
7+
8+
jobs:
9+
build:
10+
name: Build and upload
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout code ${{ github.sha }}
14+
uses: actions/checkout@v2
15+
16+
- name: Build
17+
uses: docker://node:13-slim
18+
with:
19+
entrypoint: bash
20+
args: .github/workflows/build.sh
21+
22+
- name: Create Release
23+
id: create_release
24+
uses: actions/create-release@v1
25+
env:
26+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27+
with:
28+
tag_name: ${{ github.ref }}
29+
release_name: Release ${{ github.ref }}
30+
draft: false
31+
prerelease: false
32+
33+
- name: Upload archive to release
34+
id: upload-release-asset
35+
uses: actions/upload-release-asset@v1
36+
env:
37+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
38+
with:
39+
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
40+
asset_path: ./sqlpad.tar.gz
41+
asset_name: sqlpad.tar.gz
42+
asset_content_type: application/gzip

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@ server/public
66
coverage/
77
db/
88
dbtest/
9-
node_modules/
9+
node_modules/
10+
sqlpad.tar.gz

scripts/build.sh

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@ SQLPAD_CLIENT_DIR=$(pwd)/client
33
SQLPAD_SERVER_DIR=$(pwd)/server
44
SCRIPTS_DIR=$(pwd)/scripts
55

6-
if [[ ! -d $SCRIPTS_DIR ]] || \
7-
[[ ! -d $SQLPAD_CLIENT_DIR ]] || \
8-
[[ ! -d $SQLPAD_SERVER_DIR ]]
9-
then
6+
if [ ! -d $SCRIPTS_DIR ] ||
7+
[ ! -d $SQLPAD_CLIENT_DIR ] ||
8+
[ ! -d $SQLPAD_SERVER_DIR ]; then
109
echo This script must be executed from the sqlpad project directory
1110
exit 1
1211
fi

0 commit comments

Comments
 (0)