-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6797fea
commit 49f6336
Showing
8 changed files
with
124 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: Replace text in file | ||
|
||
inputs: | ||
old-text: | ||
description: Text to replace | ||
required: true | ||
type: string | ||
new-text: | ||
description: Text to replace with | ||
required: true | ||
type: string | ||
file: | ||
description: Text to replace with | ||
required: true | ||
type: string | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Replace substring | ||
shell: bash | ||
run: sed -i 's/${{ inputs.old-text }}/${{ inputs.new-text }}/g' ${{ inputs.file }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: Replace version | ||
|
||
inputs: | ||
version: | ||
description: Version to replace with | ||
required: true | ||
type: string | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Replace string in src/main.cpp | ||
uses: ./.github/actions/replace-version | ||
with: | ||
file: src/main.cpp | ||
old-string: <local-build> | ||
new-string: ${{ inputs.version }} | ||
|
||
- name: Replace string in bin/lottie_common.sh | ||
uses: ./.github/actions/replace-version | ||
with: | ||
file: bin/lottie_common.sh | ||
old-string: <local-build> | ||
new-string: ${{ inputs.version }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,10 @@ on: | |
description: "amd64 or arm64" | ||
required: true | ||
type: string | ||
version: | ||
description: Version to replace with | ||
required: false | ||
type: string | ||
|
||
jobs: | ||
build-docker: | ||
|
@@ -27,6 +31,12 @@ jobs: | |
- name: Setup Docker buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Replace version | ||
if: ${{ inputs.version != '' }} | ||
uses: ./.github/actions/replace-version | ||
with: | ||
version: ${{ inputs.version }} | ||
|
||
- name: Build lottie-to-apng | ||
uses: docker/build-push-action@v4 | ||
with: | ||
|
@@ -37,7 +47,7 @@ jobs: | |
load: true | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max | ||
|
||
- name: Upload lottie-to-apng as artifact | ||
uses: ishworkh/[email protected] | ||
with: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,13 +19,21 @@ function print_help() { | |
echo " path Path to .json or .tgs file to convert" | ||
echo | ||
echo "Optional arguments:" | ||
echo " -h, --help show this help message and exit" | ||
echo " -h, --help shows this help message and exits" | ||
echo " -v, --version prints version information and exits" | ||
echo " --output OUTPUT Output file path" | ||
echo " --height HEIGHT Output image height. Default: $HEIGHT" | ||
echo " --width WIDTH Output image width. Default: $WIDTH" | ||
echo " --fps FPS Output frame rate. Default: $FPS" | ||
echo " --threads THREADS Number of threads to use. Default: number of CPUs" | ||
echo " --quality QUALITY Output quality. Default: $QUALITY" | ||
echo | ||
echo "It's open-source project: https://github.com/ed-asriyan/lottie-converter" | ||
echo "Author: Ed Asriyan <[email protected]>" | ||
} | ||
|
||
function print_version() { | ||
echo "<local-build>" | ||
} | ||
|
||
while [[ $# -gt 0 ]]; do | ||
|
@@ -60,10 +68,14 @@ while [[ $# -gt 0 ]]; do | |
shift | ||
shift | ||
;; | ||
--help) | ||
-h|--help) | ||
print_help | ||
exit 1 | ||
;; | ||
-v|--version) | ||
print_version | ||
exit 1 | ||
;; | ||
*) | ||
POSITIONAL_ARG=$1 | ||
shift | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,7 +35,17 @@ void convert( | |
} | ||
|
||
int main(int argc, const char** argv) { | ||
argparse::ArgumentParser program("lottie_to_png"); | ||
argparse::ArgumentParser program("lottie_to_png", "<local-build>"); | ||
|
||
program.add_description( | ||
"Lottie animations (.json) to frames as .png files converter.\n" | ||
"This executable is one of components of lottie-converter project and isn't supposed to be used directly." | ||
); | ||
|
||
program.add_epilog( | ||
"It's open-source project: https://github.com/ed-asriyan/lottie-converter\n" | ||
"Author: Ed Asriyan <[email protected]>" | ||
); | ||
|
||
program.add_argument("path") | ||
.required() | ||
|