forked from pablodenadai/node-liquibase
-
Notifications
You must be signed in to change notification settings - Fork 16
40 lines (32 loc) · 1.29 KB
/
generate.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
name: Generate Action
on:
workflow_dispatch:
inputs:
liquibase-version:
description: 'Liquibase version'
required: true
default: '4.26.0'
jobs:
create-command-list:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build liquibase-protobuf-generator
run: docker build -t liquibase-protobuf-generator:${{ inputs.liquibase-version }} . --build-arg VERSION=${{ inputs.liquibase-version }}
- name: Generate liquibase command list
run: docker run --rm -v $(pwd):/proto liquibase-protobuf-generator:${{ inputs.liquibase-version }} --output-file=commands.json list-commands
- name: Read commands from JSON file
id: read_commands
run: |
COMMANDS=$(cat commands.json | jq -r '.[]')
echo "COMMANDS=$COMMANDS" >> $GITHUB_ENV
- name: Iterate over commands and execute Docker command
run: |
IFS=$'\n'
for command in $COMMANDS; do
docker run --rm -v $(pwd):/proto liquibase-protobuf-generator:${{ inputs.liquibase-version }} generate-protobuf --target-command="$command" --output-dir /proto
done
- uses: actions/upload-artifact@v3
with:
name: commands-${{ inputs.liquibase-version }}
path: '*.proto'