Skip to content

Commit

Permalink
feat: add mutool and muraster layer and upload it to artifact and rel…
Browse files Browse the repository at this point in the history
…ease (#3)

* feat: add mutool and muraster layer and upload it to artifact and release

* fix: fix Create the mupdf-layer.zip layer folder
  • Loading branch information
rwv authored Oct 29, 2024
1 parent 1306869 commit f4fed64
Showing 1 changed file with 70 additions and 16 deletions.
86 changes: 70 additions & 16 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,24 +38,74 @@ jobs:
cd mupdf-${{ env.MUPDF_VERSION }}-source
make HAVE_X11=no HAVE_GLUT=no prefix=/usr/local install
- name: Create the layer
- name: Create the mupdf-layer.zip layer
run: |
mkdir -p layer/bin
cp /usr/local/bin/mutool layer/bin/
cp /usr/local/bin/muraster layer/bin/
mkdir -p layer/lib
ldd /usr/local/bin/mutool | grep '=>' | awk '{print $3}' | xargs -I '{}' cp -v '{}' layer/lib
ldd /usr/local/bin/muraster | grep '=>' | awk '{print $3}' | xargs -I '{}' cp -v '{}' layer/lib
cd layer
mkdir -p mupdf-layer/bin
cp /usr/local/bin/mutool mupdf-layer/bin/
cp /usr/local/bin/muraster mupdf-layer/bin/
mkdir -p mupdf-layer/lib
ldd /usr/local/bin/mutool | grep '=>' | awk '{print $3}' | xargs -I '{}' cp -v '{}' mupdf-layer/lib
ldd /usr/local/bin/muraster | grep '=>' | awk '{print $3}' | xargs -I '{}' cp -v '{}' mupdf-layer/lib
cd mupdf-layer
zip -r9 ../mupdf-layer.zip .
cd ..
- name: Upload the layer to GitHub Actions Artifacts
- name: Create the mutool-layer.zip layer
run: |
mkdir -p mutool-layer/bin
cp /usr/local/bin/mutool mutool-layer/bin/
mkdir -p mutool-layer/lib
ldd /usr/local/bin/mutool | grep '=>' | awk '{print $3}' | xargs -I '{}' cp -v '{}' mutool-layer/lib
cd mutool-layer
zip -r9 ../mutool-layer.zip .
cd ..
- name: Create the muraster-layer.zip layer
run: |
mkdir -p muraster-layer/bin
cp /usr/local/bin/muraster muraster-layer/bin/
mkdir -p muraster-layer/lib
ldd /usr/local/bin/muraster | grep '=>' | awk '{print $3}' | xargs -I '{}' cp -v '{}' muraster-layer/lib
cd muraster-layer
zip -r9 ../muraster-layer.zip .
cd ..
- name: Upload mupdf-layer.zip to GitHub Actions Artifacts
uses: actions/upload-artifact@v4
with:
name: mupdf-layer
name: mupdf-layer.zip
path: mupdf-layer.zip

- name: Upload mutool-layer.zip to GitHub Actions Artifacts
uses: actions/upload-artifact@v4
with:
name: mutool-layer.zip
path: mutool-layer.zip

- name: Upload muraster-layer.zip to GitHub Actions Artifacts
uses: actions/upload-artifact@v4
with:
name: muraster-layer.zip
path: muraster-layer.zip

- name: Upload mupdf-layer.zip to GitHub Releases
uses: svenstaro/upload-release-action@v2
if: github.event_name == 'release'
with:
file: mupdf-layer.zip

- name: Upload mutool-layer.zip to GitHub Releases
uses: svenstaro/upload-release-action@v2
if: github.event_name == 'release'
with:
file: mutool-layer.zip

- name: Upload muraster-layer.zip to GitHub Releases
uses: svenstaro/upload-release-action@v2
if: github.event_name == 'release'
with:
file: muraster-layer.zip

- name: Login to AWS
if: github.event_name == 'release'
run: |
Expand All @@ -67,6 +117,8 @@ jobs:
if: github.event_name == 'release'
run: |
aws s3 cp mupdf-layer.zip s3://${{ secrets.S3_BUCKET }}/mupdf-layer.zip
aws s3 cp mutool-layer.zip s3://${{ secrets.S3_BUCKET }}/mutool-layer.zip
aws s3 cp muraster-layer.zip s3://${{ secrets.S3_BUCKET }}/muraster-layer.zip
- name: Deploy the layer to the artifact registry
if: github.event_name == 'release'
Expand All @@ -75,9 +127,11 @@ jobs:
--layer-name mupdf \
--content S3Bucket=${{ secrets.S3_BUCKET }},S3Key=mupdf-layer.zip \
--description "MuPDF CLI tools v${{ env.MUPDF_VERSION }}"
- name: Upload to GitHub Releases
uses: svenstaro/upload-release-action@v2
if: github.event_name == 'release'
with:
file: mupdf-layer.zip
aws lambda publish-layer-version \
--layer-name mutool \
--content S3Bucket=${{ secrets.S3_BUCKET }},S3Key=mutool-layer.zip \
--description "MuPDF CLI tools (mutool) v${{ env.MUPDF_VERSION }}"
aws lambda publish-layer-version \
--layer-name muraster \
--content S3Bucket=${{ secrets.S3_BUCKET }},S3Key=muraster-layer.zip \
--description "MuPDF CLI tools (muraster) v${{ env.MUPDF_VERSION }}"

0 comments on commit f4fed64

Please sign in to comment.