-
Notifications
You must be signed in to change notification settings - Fork 77
165 lines (143 loc) · 5.22 KB
/
cd-release.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
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 }}
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
needs: build-docker-and-linux
runs-on: ubuntu-latest
strategy:
matrix:
image:
- lottie-to-apng
- lottie-to-gif
- lottie-to-png
- lottie-to-webp
arch:
- amd64
- arm64
steps:
- name: Download ${{ matrix.image }} image as artifact
uses: ishworkh/[email protected]
with:
image: "${{ matrix.image }}:${{ matrix.arch }}"
- name: Tag image
run: docker image tag ${{ matrix.image }}:${{ matrix.arch }} ${{ secrets.DOCKERHUB_USERNAME }}/${{ matrix.image }}:${{ matrix.arch }}
- 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.arch }}
push-docker-manifest:
name: Push manifest to DockerHub
needs: push-docker-image
runs-on: ubuntu-latest
strategy:
matrix:
format:
- apng
- gif
- png
- webp
steps:
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- 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 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 in readme for DockerHub
uses: ./.github/actions/replace-version
with:
file: README.dockerhub.md
old-string: FORMAT
new-string: ${{ steps.format.outputs.uppercase }}
- name: Find and replace format in readme for DockerHub
uses: ./.github/actions/replace-version
with:
file: README.dockerhub.md
old-string: format
new-string: ${{ matrix.format }}
- name: Update description at DockerHub
uses: peter-evans/dockerhub-description@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
repository: ${{ secrets.DOCKERHUB_USERNAME }}/lottie-to-${{ matrix.format }}
short-description: Converts Lottie Animations (.json / .lottie) and Telegram stickers (*.tgs) to ${{ steps.format.outputs.uppercase }}}
readme-filepath: README.dockerhub.md
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