Skip to content

Commit

Permalink
build.yml: optimizations, better packaging
Browse files Browse the repository at this point in the history
  • Loading branch information
makigumo committed Jun 26, 2021
1 parent 064c42a commit 3f92767
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 8 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,8 @@ jobs:
SaxonEE10-3J.zip
key: ${{ runner.os }}-saxon
- name: Download wadoku.de XML data
if: steps.cache-wadoku.outputs.cache-hit != 'true'
run: |
curl https://www.wadoku.de/downloads/xml-export/wadoku-xml-latest.tar.xz --output wadoku-xml.tar.xz --silent
curl https://www.wadoku.de/downloads/xml-export/wadoku-xml-latest.tar.xz --output wadoku-xml.tar.xz -z wadoku-xml.tar.xz --silent
- name: Extract wadoku.de XML data
run: |
tar xf wadoku-xml.tar.xz
Expand All @@ -46,10 +45,11 @@ jobs:
env:
LFILE: ${{ secrets.SECRET_KAGI }}
run: |
echo "$LFILE" > saxon-license.lic
ls -l saxon-license.lic
echo "::add-mask::${{ secrets.LNUM }}"
echo "::add-mask::${{ secrets.LFNAME }}"
echo "$LFILE" > "${{ secrets.LFNAME }}"
WADOKU_DIR=$(find . -name 'wadoku-xml-*' -type d) && export WADOKU_DIR=$WADOKU_DIR
java -Xmx1024M -jar saxon-ee-10.3.jar -s:$WADOKU_DIR/wadoku.xml -opt:10 -t -xsl:xsl/entry_export_macdic.xslt -o:wadoku-mac.xml
java -Xmx1024M -jar saxon-ee-10.3.jar -s:$WADOKU_DIR/wadoku.xml -t -xsl:xsl/entry_export_macdic.xslt -o:wadoku-mac.xml
- name: Prepare plist file and dates
id: date
run: |
Expand All @@ -59,6 +59,7 @@ jobs:
export VERSION_DATE=$(date -j -f %Y%m%d $DATE +%Y.%m.%d)
export GERMAN_DATE=$(LC_ALL=de_DE date -j -f %Y%m%d $DATE '+%e. %B %Y')
cat Wadoku.plist.in | m4 -DYEAR="$YEAR" -DVERSION_DATE="$VERSION_DATE" -DGERMAN_DATE="$GERMAN_DATE" > Wadoku.plist
cat pkg/pkg.json.in | m4 -DVERSION_DATE="$VERSION_DATE" > pkg/pkg.json
echo "::set-output name=release-date::$DATE"
echo "::set-output name=date::$(date +'%Y%m%d')"
- name: Prepare images
Expand All @@ -72,12 +73,11 @@ jobs:
make
- name: Package dictionary
run: |
hdiutil create tmp.dmg -ov -volname "Wadoku ${{ steps.date.outputs.date }}" -fs HFS+ -srcfolder "./objects/Wadoku.dictionary"
hdiutil convert tmp.dmg -format UDZO -o "Wadoku${{ steps.date.outputs.date }}.dictionary.dmg"
npm install -g appdmg
appdmg pkg/pkg.json "Wadoku${{ steps.date.outputs.date }}.dictionary.dmg"
- name: Cleanup
run: |
make clean
rm tmp.dmg
- name: Create Release
uses: ncipollo/release-action@v1
with:
Expand Down
Binary file added pkg/bg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 25 additions & 0 deletions pkg/pkg.json.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"title": "Wadoku VERSION_DATE",
"background": "bg.png",
"contents": [
{
"x": 399,
"y": 159,
"type": "link",
"path": "/Library/Dictionaries/"
},
{
"x": 131,
"y": 159,
"type": "file",
"path": "../objects/Wadoku.dictionary"
}
],
"window": {
"size": {
"width": 530,
"height": 300
}
},
"format": "ULFO"
}

0 comments on commit 3f92767

Please sign in to comment.