Skip to content

Commit

Permalink
Merge pull request #14 from SergeiPatiakin/github-actions
Browse files Browse the repository at this point in the history
Add Github Actions workflow
  • Loading branch information
najdanovicivan authored Feb 1, 2024
2 parents d813642 + ec2e247 commit 903f37c
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .github/scripts/patch_info_plist.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/usr/bin/env python3
from xml.dom import minidom

main_path = 'out/ePorezi.app/Contents/Info.plist'
main_doc = minidom.parse(main_path)

append_str = '''
<doc>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLName</key>
<string>ePorezi</string>
<key>CFBundleURLSchemes</key>
<array>
<string>eporezi</string>
</array>
</dict>
</array>
</doc>
'''
append_doc = minidom.parseString(append_str)

for append_node in list(append_doc.childNodes[0].childNodes):
main_doc.childNodes[0].childNodes[1].appendChild(append_node)

with open(main_path, 'w') as f:
f.write(main_doc.toxml())
31 changes: 31 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Java CI

on: [push]

jobs:
build:
runs-on: macos-latest

steps:
- uses: actions/checkout@v3

- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: '8'
distribution: 'temurin'

- name: Compile with Ant
run: ant compile

- name: Bundle with Ant
run: ant bundle

- name: Patch Info.plist
run: python3 .github/scripts/patch_info_plist.py

- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: out-dir
path: out/**

0 comments on commit 903f37c

Please sign in to comment.