-
Notifications
You must be signed in to change notification settings - Fork 78
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
07307cd
commit 82ee09f
Showing
4 changed files
with
166 additions
and
97 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,128 @@ | ||
name: CD | Release & Push to DockerHub | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v[0-9].[0-9]+.[0-9]+' | ||
|
||
jobs: | ||
build-docker-and-linux: | ||
name: Build Docker image & Linux executable | ||
uses: ./.github/workflows/build-linux-and-docker.yml | ||
strategy: | ||
matrix: | ||
arch: | ||
- arm64 | ||
- amd64 | ||
with: | ||
output-artifact-name: lottie-to-png.linux.${{ matrix.arch }} | ||
arch: ${{ matrix.arch }} | ||
|
||
build-darwin: | ||
name: Build Darwin executable | ||
uses: ./.github/workflows/build-darwin.yml | ||
with: | ||
output-artifact-name: lottie-to-png.darwin.amd64 | ||
|
||
build-windows: | ||
name: Build Windows executable | ||
uses: ./.github/workflows/build-windows.yml | ||
with: | ||
output-artifact-name: lottie-to-png.windows.amd64.exe | ||
|
||
push-image: | ||
name: Push images to DockerHub | ||
needs: build-docker-and-linux | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
image: | ||
- lottie-to-apng | ||
- lottie-to-gif | ||
- lottie-to-png | ||
- lottie-to-webp | ||
platform: | ||
- amd64 | ||
- arm64 | ||
steps: | ||
- name: Download ${{ matrix.image }} image as artifact | ||
uses: ishworkh/[email protected] | ||
with: | ||
image: "${{ matrix.image }}:${{ inputs.arch }}" | ||
|
||
- name: Tag image | ||
run: docker image tag ${{ matrix.image }}:${{ matrix.platform }} ${{ secrets.DOCKERHUB_USERNAME }}/${{ matrix.image }}:${{ matrix.platform }} | ||
|
||
- name: Login to DockerHub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Push ${{ matrix.image }} to DockerHub | ||
run: docker push ${{ secrets.DOCKERHUB_USERNAME }}/${{ matrix.image }}:${{ matrix.platform }} | ||
|
||
push-manifest: | ||
name: Push manifest to DockerHub | ||
needs: push-image | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
image: | ||
- lottie-to-apng | ||
- lottie-to-gif | ||
- lottie-to-png | ||
- lottie-to-webp | ||
steps: | ||
- name: Login to DockerHub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Create manifest | ||
run: docker manifest create ${{ secrets.DOCKERHUB_USERNAME }}/${{ matrix.image }}:latest ${{ secrets.DOCKERHUB_USERNAME }}/${{ matrix.image }}:${{ github.ref }} --amend ${{ secrets.DOCKERHUB_USERNAME }}/${{ matrix.image }}:amd64 --amend ${{ secrets.DOCKERHUB_USERNAME }}/${{ matrix.image }}:arm64 | ||
|
||
- name: Create manifest | ||
run: docker manifest create ${{ secrets.DOCKERHUB_USERNAME }}/${{ matrix.image }}:latest ${{ secrets.DOCKERHUB_USERNAME }}/${{ matrix.image }}:${{ github.ref }} --amend ${{ secrets.DOCKERHUB_USERNAME }}/${{ matrix.image }}:amd64 --amend ${{ secrets.DOCKERHUB_USERNAME }}/${{ matrix.image }}:arm64 | ||
|
||
- name: Push manifest | ||
run: docker manifest push ${{ secrets.DOCKERHUB_USERNAME }}/${{ matrix.image }}:latest ${{ secrets.DOCKERHUB_USERNAME }}/${{ matrix.image }}:${{ github.ref }} | ||
|
||
create-release: | ||
name: Release executables | ||
needs: | ||
- build-docker-and-linux | ||
- build-darwin | ||
- build-windows | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
file: | ||
- linux.amd64 | ||
- linux.arm64 | ||
- darwin.amd64 | ||
- windows.amd64.exe | ||
env: | ||
filename: lottie-converter.${{ matrix.file }}.zip | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Download artifact | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: lottie-to-png.${{ matrix.file }} | ||
path: bin | ||
|
||
- name: Archive Release | ||
uses: thedoctor0/[email protected] | ||
with: | ||
type: 'zip' | ||
path: bin | ||
filename: ${{ env.filename }} | ||
|
||
- name: Release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
files: ${{ env.filename }} | ||
draft: true |
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 |
---|---|---|
|
@@ -27,7 +27,7 @@ jobs: | |
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
|
||
- name: Download ${{ matrix.image }} image as artefact | ||
- name: Download ${{ matrix.image }} image as artifact | ||
uses: ishworkh/[email protected] | ||
with: | ||
image: lottie-to-${{ matrix.image }}:${{ inputs.arch }} | ||
|
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