Skip to content

Commit 7bd8bbd

Browse files
author
Colin Viebrock
committed
Create workflow for releasing bundles for Sequel Pro and Sequel Ace
1 parent f6cc97b commit 7bd8bbd

File tree

8 files changed

+71
-6
lines changed

8 files changed

+71
-6
lines changed

.github/workflows/build.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Create Release
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: 'Version of the release (x.x.x)'
8+
required: true
9+
10+
jobs:
11+
build:
12+
name: Create Release
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout Code
16+
uses: actions/checkout@v2
17+
- name: Build Assets
18+
run: ./build.sh
19+
- name: Create Release
20+
id: create_release
21+
uses: actions/create-release@v1
22+
env:
23+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
24+
with:
25+
tag_name: ${{ github.event.inputs.version }}
26+
release_name: Release ${{ github.event.inputs.version }}
27+
draft: false
28+
prerelease: false
29+
- name: Upload Assets
30+
id: upload-assets
31+
uses: alexellis/[email protected]
32+
env:
33+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34+
with:
35+
asset_paths: '["./build/*.zip"]'

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
*.tsv
2-
/ExportToLaravelMigration.spBundle/0
32
.idea
4-
.DS_Store
3+
/build/

build.sh

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/usr/bin/env bash
2+
3+
DIR=$(pwd)
4+
SRC="${DIR}/src"
5+
BUILD="${DIR}/build"
6+
BUNDLE_SA="ExportToLaravelMigration.saBundle"
7+
BUNDLE_SP="ExportToLaravelMigration.spBundle"
8+
BUILD_SA="${BUILD}/${BUNDLE_SA}"
9+
BUILD_SP="${BUILD}/${BUNDLE_SP}"
10+
SA_ZIP="${BUILD}/ExportToLaravelMigration-SequelAce.zip"
11+
SP_ZIP="${BUILD}/ExportToLaravelMigration-SequelPro.zip"
12+
13+
# create fresh build dirs
14+
rm -rf "${BUILD}"
15+
mkdir -p "${BUILD}/${BUNDLE_SA}"
16+
mkdir -p "${BUILD}/${BUNDLE_SP}"
17+
18+
# copy source to Sequel Ace and Sequel Pro directories
19+
cd "${SRC}"
20+
cp * "${BUILD}/${BUNDLE_SA}"
21+
cp * "${BUILD}/${BUNDLE_SA}"
22+
cd "${DIR}"
23+
24+
# perform required search-and-replace for Pro->Ace changes
25+
sed -e 's/sequelpro:\/\//sequelace:\/\//g' -i "" "${BUILD}/${BUNDLE_SA}/parse.sh"
26+
27+
# create zip artifacts
28+
cd "${BUILD}"
29+
zip -9 -r "${SA_ZIP}" "./${BUNDLE_SA}"
30+
zip -9 -r "${SP_ZIP}" "./${BUNDLE_SP}"
31+
cd "${DIR}"
File renamed without changes.

ExportToLaravelMigration.spBundle/create.stub renamed to src/create.stub

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use Illuminate\Database\Schema\Blueprint;
55
use Illuminate\Database\Migrations\Migration;
66

77
/**
8-
* Migration auto-generated by Sequel Pro Laravel Export (:VERSION:)
8+
* Migration auto-generated by Sequel Pro/Ace Laravel Export (:VERSION:)
99
* @see https://github.com/cviebrock/sequel-pro-laravel-export
1010
*/
1111
class DummyClass extends Migration
File renamed without changes.

ExportToLaravelMigration.spBundle/parse.sh renamed to src/parse.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ execute_sql()
1313
# execute the SQL statement; the result will be available in the file $SP_QUERY_RESULT_FILE
1414
open "sequelpro://$SP_PROCESS_ID@passToDoc/ExecuteQuery"
1515

16-
# wait for Sequel Pro; status file will be written to disk if query was finished
16+
# wait for results; status file will be written to disk if query was finished
1717
while [ 1 ]
1818
do
1919
[[ -e "$SP_QUERY_RESULT_STATUS_FILE" ]] && break
@@ -105,7 +105,7 @@ do
105105

106106
clear_temp
107107

108-
# send SHOW INDEXES query to Sequel Pro
108+
# build SHOW INDEXES query
109109
echo "SHOW INDEXES FROM \`${table}\`" > "$SP_QUERY_FILE"
110110

111111
# execute and save the SHOW INDEXES result
@@ -157,7 +157,7 @@ do
157157
if [ "$CONSTRAINTS_TABLE" == "yes" ] && [ `cat "$SP_QUERY_RESULT_STATUS_FILE"` -gt 0 ]; then
158158
clear_temp
159159

160-
# send CONSTRAINTS query to Sequel Pro
160+
# build CONSTRAINTS query
161161
echo "
162162
SELECT
163163
kcu.CONSTRAINT_NAME, kcu.COLUMN_NAME, kcu.REFERENCED_TABLE_NAME, kcu.REFERENCED_COLUMN_NAME, rc.UPDATE_RULE, rc.DELETE_RULE

0 commit comments

Comments
 (0)