Skip to content

Commit f4fed64

Browse files
authored
feat: add mutool and muraster layer and upload it to artifact and release (#3)
* feat: add mutool and muraster layer and upload it to artifact and release * fix: fix Create the mupdf-layer.zip layer folder
1 parent 1306869 commit f4fed64

File tree

1 file changed

+70
-16
lines changed

1 file changed

+70
-16
lines changed

.github/workflows/build.yml

+70-16
Original file line numberDiff line numberDiff line change
@@ -38,24 +38,74 @@ jobs:
3838
cd mupdf-${{ env.MUPDF_VERSION }}-source
3939
make HAVE_X11=no HAVE_GLUT=no prefix=/usr/local install
4040
41-
- name: Create the layer
41+
- name: Create the mupdf-layer.zip layer
4242
run: |
43-
mkdir -p layer/bin
44-
cp /usr/local/bin/mutool layer/bin/
45-
cp /usr/local/bin/muraster layer/bin/
46-
mkdir -p layer/lib
47-
ldd /usr/local/bin/mutool | grep '=>' | awk '{print $3}' | xargs -I '{}' cp -v '{}' layer/lib
48-
ldd /usr/local/bin/muraster | grep '=>' | awk '{print $3}' | xargs -I '{}' cp -v '{}' layer/lib
49-
cd layer
43+
mkdir -p mupdf-layer/bin
44+
cp /usr/local/bin/mutool mupdf-layer/bin/
45+
cp /usr/local/bin/muraster mupdf-layer/bin/
46+
mkdir -p mupdf-layer/lib
47+
ldd /usr/local/bin/mutool | grep '=>' | awk '{print $3}' | xargs -I '{}' cp -v '{}' mupdf-layer/lib
48+
ldd /usr/local/bin/muraster | grep '=>' | awk '{print $3}' | xargs -I '{}' cp -v '{}' mupdf-layer/lib
49+
cd mupdf-layer
5050
zip -r9 ../mupdf-layer.zip .
5151
cd ..
5252
53-
- name: Upload the layer to GitHub Actions Artifacts
53+
- name: Create the mutool-layer.zip layer
54+
run: |
55+
mkdir -p mutool-layer/bin
56+
cp /usr/local/bin/mutool mutool-layer/bin/
57+
mkdir -p mutool-layer/lib
58+
ldd /usr/local/bin/mutool | grep '=>' | awk '{print $3}' | xargs -I '{}' cp -v '{}' mutool-layer/lib
59+
cd mutool-layer
60+
zip -r9 ../mutool-layer.zip .
61+
cd ..
62+
63+
- name: Create the muraster-layer.zip layer
64+
run: |
65+
mkdir -p muraster-layer/bin
66+
cp /usr/local/bin/muraster muraster-layer/bin/
67+
mkdir -p muraster-layer/lib
68+
ldd /usr/local/bin/muraster | grep '=>' | awk '{print $3}' | xargs -I '{}' cp -v '{}' muraster-layer/lib
69+
cd muraster-layer
70+
zip -r9 ../muraster-layer.zip .
71+
cd ..
72+
73+
- name: Upload mupdf-layer.zip to GitHub Actions Artifacts
5474
uses: actions/upload-artifact@v4
5575
with:
56-
name: mupdf-layer
76+
name: mupdf-layer.zip
5777
path: mupdf-layer.zip
5878

79+
- name: Upload mutool-layer.zip to GitHub Actions Artifacts
80+
uses: actions/upload-artifact@v4
81+
with:
82+
name: mutool-layer.zip
83+
path: mutool-layer.zip
84+
85+
- name: Upload muraster-layer.zip to GitHub Actions Artifacts
86+
uses: actions/upload-artifact@v4
87+
with:
88+
name: muraster-layer.zip
89+
path: muraster-layer.zip
90+
91+
- name: Upload mupdf-layer.zip to GitHub Releases
92+
uses: svenstaro/upload-release-action@v2
93+
if: github.event_name == 'release'
94+
with:
95+
file: mupdf-layer.zip
96+
97+
- name: Upload mutool-layer.zip to GitHub Releases
98+
uses: svenstaro/upload-release-action@v2
99+
if: github.event_name == 'release'
100+
with:
101+
file: mutool-layer.zip
102+
103+
- name: Upload muraster-layer.zip to GitHub Releases
104+
uses: svenstaro/upload-release-action@v2
105+
if: github.event_name == 'release'
106+
with:
107+
file: muraster-layer.zip
108+
59109
- name: Login to AWS
60110
if: github.event_name == 'release'
61111
run: |
@@ -67,6 +117,8 @@ jobs:
67117
if: github.event_name == 'release'
68118
run: |
69119
aws s3 cp mupdf-layer.zip s3://${{ secrets.S3_BUCKET }}/mupdf-layer.zip
120+
aws s3 cp mutool-layer.zip s3://${{ secrets.S3_BUCKET }}/mutool-layer.zip
121+
aws s3 cp muraster-layer.zip s3://${{ secrets.S3_BUCKET }}/muraster-layer.zip
70122
71123
- name: Deploy the layer to the artifact registry
72124
if: github.event_name == 'release'
@@ -75,9 +127,11 @@ jobs:
75127
--layer-name mupdf \
76128
--content S3Bucket=${{ secrets.S3_BUCKET }},S3Key=mupdf-layer.zip \
77129
--description "MuPDF CLI tools v${{ env.MUPDF_VERSION }}"
78-
79-
- name: Upload to GitHub Releases
80-
uses: svenstaro/upload-release-action@v2
81-
if: github.event_name == 'release'
82-
with:
83-
file: mupdf-layer.zip
130+
aws lambda publish-layer-version \
131+
--layer-name mutool \
132+
--content S3Bucket=${{ secrets.S3_BUCKET }},S3Key=mutool-layer.zip \
133+
--description "MuPDF CLI tools (mutool) v${{ env.MUPDF_VERSION }}"
134+
aws lambda publish-layer-version \
135+
--layer-name muraster \
136+
--content S3Bucket=${{ secrets.S3_BUCKET }},S3Key=muraster-layer.zip \
137+
--description "MuPDF CLI tools (muraster) v${{ env.MUPDF_VERSION }}"

0 commit comments

Comments
 (0)