-
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
e32fe78
commit f208edf
Showing
7 changed files
with
102 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,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: MathieuSoysal/[email protected] | ||
with: | ||
file: src/main.cpp | ||
old-string: <local-build> | ||
new-string: ${{ inputs.version }} | ||
|
||
- name: Replace string in bin/lottie-converter.sh | ||
uses: MathieuSoysal/[email protected] | ||
with: | ||
file: bin/lottie-converter.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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,18 +17,21 @@ jobs: | |
with: | ||
output-artifact-name: lottie-to-png.linux.${{ matrix.arch }} | ||
arch: ${{ matrix.arch }} | ||
version: ${{ github.ref_name }} | ||
|
||
build-darwin: | ||
name: Build Darwin executable | ||
uses: ./.github/workflows/build-darwin.yml | ||
with: | ||
output-artifact-name: lottie-to-png.darwin.amd64 | ||
version: ${{ github.ref_name }} | ||
|
||
build-windows: | ||
name: Build Windows executable | ||
uses: ./.github/workflows/build-windows.yml | ||
with: | ||
output-artifact-name: lottie-to-png.windows.amd64.exe | ||
version: ${{ github.ref_name }} | ||
|
||
push-docker-image: | ||
name: Push images to DockerHub | ||
|
@@ -80,33 +83,39 @@ jobs: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Create manifest | ||
- name: Create manifest of latest tag | ||
run: docker manifest create ${{ secrets.DOCKERHUB_USERNAME }}/lottie-to-${{ matrix.format }}:latest --amend ${{ secrets.DOCKERHUB_USERNAME }}/lottie-to-${{ matrix.format }}:amd64 --amend ${{ secrets.DOCKERHUB_USERNAME }}/lottie-to-${{ matrix.format }}:arm64 | ||
|
||
- name: Push manifest | ||
- name: Push manifest of latest tag | ||
run: docker manifest push ${{ secrets.DOCKERHUB_USERNAME }}/lottie-to-${{ matrix.format }}:latest | ||
|
||
- name: Create manifest of version tag | ||
run: docker manifest create ${{ secrets.DOCKERHUB_USERNAME }}/lottie-to-${{ matrix.format }}:${{ github.ref_name }} --amend ${{ secrets.DOCKERHUB_USERNAME }}/lottie-to-${{ matrix.format }}:amd64 --amend ${{ secrets.DOCKERHUB_USERNAME }}/lottie-to-${{ matrix.format }}:arm64 | ||
|
||
- name: Push manifest of version tag | ||
run: docker manifest push ${{ secrets.DOCKERHUB_USERNAME }}/lottie-to-${{ matrix.format }}:${{ github.ref_name }} | ||
|
||
- name: Make format uppercase | ||
id: format | ||
uses: ASzc/change-string-case-action@v5 | ||
with: | ||
string: ${{ matrix.format }} | ||
|
||
- uses: actions/checkout@v4 | ||
- name: Find and replace FORMAT | ||
uses: jacobtomlinson/gha-find-replace@v3 | ||
|
||
- name: Find and replace FORMAT in readme for DockerHub | ||
uses: MathieuSoysal/[email protected] | ||
with: | ||
find: FORMAT | ||
replace: ${{ steps.format.outputs.uppercase }} | ||
regex: false | ||
file: README.dockerhub.md | ||
old-string: FORMAT | ||
new-string: ${{ steps.format.outputs.uppercase }} | ||
|
||
- name: Find and replace format | ||
uses: jacobtomlinson/gha-find-replace@v3 | ||
- name: Find and replace format in readme for DockerHub | ||
uses: MathieuSoysal/[email protected] | ||
with: | ||
find: format | ||
replace: ${{ matrix.format }} | ||
regex: false | ||
file: README.dockerhub.md | ||
old-string: format | ||
new-string: ${{ matrix.format }} | ||
|
||
- name: Update description at DockerHub | ||
uses: peter-evans/dockerhub-description@v3 | ||
|
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() | ||
|