From cd502aedca0e5ae3b7de9ff0ac1c2ffc1489b9ab Mon Sep 17 00:00:00 2001 From: Atsushi Matsuo Date: Sat, 7 Sep 2024 21:25:39 +0900 Subject: [PATCH] Update a workflow file for GitHub Actions to create dmg format file --- .github/workflows/go.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 2f3ffe0..24afb0e 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -115,3 +115,18 @@ jobs: OS=linux "./goss-linux-arm64" --gossfile tests/goss.yaml validate --format documentation ./fmcsadmin -v EOF + + - name: Create dmg format file for macOS + if: runner.os == 'macOS' + run: | + lipo -info "dist/fmcsadmin-${{ env.fmcsadmin_version }}-macos/fmcsadmin" + cd "dist/fmcsadmin-${{ env.fmcsadmin_version }}-macos" + pkgbuild --root . --identifier jp.co.emic.fmcsadmin --version "${{ env.fmcsadmin_version }}" --install-location /usr/local/bin ../fmcsadmin.pkg + cd .. + cp -p ../{LICENSE.txt,README.md,NOTICE.txt,release-notes.txt} . + cp -p ../macOS/{Distribution.xml,welcome.txt} . + productbuild --distribution Distribution.xml --resources . --package-path fmcsadmin.pkg "fmcsadmin-${{ env.fmcsadmin_version }}-unsigned.pkg" + cp -p "fmcsadmin-${{ env.fmcsadmin_version }}-unsigned.pkg" "fmcsadmin-${{ env.fmcsadmin_version }}.pkg" + mkdir macos-dist + mv "{fmcsadmin-${{ env.fmcsadmin_version }}.pkg,LICENSE.txt,README.md,NOTICE.txt,release-notes.txt}" macos-dist/ + hdiutil create -srcfolder ./macos-dist/ -fs HFS+ -format UDZO -volname "fmcsadmin-${{ env.fmcsadmin_version }}" "fmcsadmin-${{ env.fmcsadmin_version }}-macos.dmg"