Skip to content

Commit

Permalink
Ensure release are uploaded
Browse files Browse the repository at this point in the history
  • Loading branch information
socheatsok78 committed Jan 31, 2024
1 parent bbd296f commit 07b2df2
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ on:
push:
branches:
- main
tags:
- v*.*.*
pull_request:
branches:
- main
Expand All @@ -24,3 +26,10 @@ jobs:

- name: Build Khmer Unicode.pkg
run: make installer

# if a release is being created, upload the package to the release
- name: Upload releases
if: startsWith(github.event.ref, 'refs/tags/v')
uses: softprops/action-gh-release@v1
with:
files: release
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
build/
release/

# Created by https://www.gitignore.io/api/osx
# Edit at https://www.gitignore.io/?templates=osx
Expand Down
12 changes: 9 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
XOCDEBUILD=/usr/bin/xcodebuild
PACKAGES=/usr/local/bin/packagesbuild
RELEASE_DIR=$(PWD)/release
CONFIGURATION_BUILD_DIR=$(PWD)/build/KhmerUnicodeBundle/Products/Release

.PHONY: main
Expand All @@ -19,7 +20,7 @@ build-info:

.PHONY: build
build: build-info
@mkdir -p build
@mkdir -p {build,release}
@echo "Building Khmer Unicode Keyboard [Bundle]\n"
@$(XOCDEBUILD) -project src/KhmerUnicodeBundle/KhmerUnicode.xcodeproj \
-scheme "[Release] KhmerUnicode" \
Expand All @@ -28,6 +29,9 @@ build: build-info
@echo "Copying KhmerUnicode.bundle to KhmerUnicodeInstaller..."
@cp -r "build/KhmerUnicodeBundle/Products/Release/KhmerUnicode.bundle" \
"src/KhmerUnicodeInstaller/Library/Keyboard Layouts"
@echo "Creating KhmerUnicode.bundle.zip..."
@cd "build/KhmerUnicodeBundle/Products/Release" && \
zip -r "$(RELEASE_DIR)/KhmerUnicode.bundle.zip" KhmerUnicode.bundle
@echo "\n[DONE] Ready to build the installer!"

installer:
Expand All @@ -36,10 +40,12 @@ installer:
@mkdir build/KhmerUnicodeInstaller
@$(PACKAGES) \
--verbose \
./src/KhmerUnicodeInstaller/Packages.pkgproj \
./src/KhmerUnicodeInstaller/Packages.pkgproj
@cp "build/KhmerUnicodeInstaller/Khmer Unicode.pkg" \
"$(RELEASE_DIR)/Khmer Unicode.pkg"

clean:
@echo "Cleaning up..."
@rm -rf build
@rm -rf {build,release}
@rm -rf "src/KhmerUnicodeInstaller/Library/Keyboard Layouts/KhmerUnicode.bundle"
@echo "[DONE] Cleanup completed!\n"

0 comments on commit 07b2df2

Please sign in to comment.