Skip to content

Commit

Permalink
fix(generate.yml): update job name to reflect the generation of a lis…
Browse files Browse the repository at this point in the history
…t of liquibase commands

feat(generate.yml): add steps to read commands from JSON file, iterate over commands, and execute Docker command for each
feat(generate.yml): update artifact name to include liquibase version dynamically
feat(gitignore): add *.proto files to the list of ignored files
  • Loading branch information
jandroav committed Mar 4, 2024
1 parent b1a98b9 commit ea3d27d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
19 changes: 16 additions & 3 deletions .github/workflows/generate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,23 @@ jobs:
- name: Build liquibase-protobuf-generator
run: docker build -t liquibase-protobuf-generator:${{ inputs.liquibase-version }} . --build-arg VERSION=${{ inputs.liquibase-version }}

- name: Generate liquibase commands
- 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-$LIQUIBASE_VERSION
path: commands.json
name: commands-${{ inputs.liquibase-version }}
path: '*.proto'
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ node_modules
coverage
.npmrc
commands.json
*.proto


# Mac OS
.DS_Store
Expand Down

0 comments on commit ea3d27d

Please sign in to comment.