From 07b2df2f5d1e31eaee571395e3ed33b997d5874e Mon Sep 17 00:00:00 2001 From: Socheat Sok Date: Thu, 1 Feb 2024 00:58:13 +0700 Subject: [PATCH] Ensure release are uploaded --- .github/workflows/build.yml | 9 +++++++++ .gitignore | 1 + Makefile | 12 +++++++++--- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6508e14..eee59f6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,6 +4,8 @@ on: push: branches: - main + tags: + - v*.*.* pull_request: branches: - main @@ -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 diff --git a/.gitignore b/.gitignore index 0bc143c..6a223bd 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ build/ +release/ # Created by https://www.gitignore.io/api/osx # Edit at https://www.gitignore.io/?templates=osx diff --git a/Makefile b/Makefile index 8f3cb18..1adeaa4 100644 --- a/Makefile +++ b/Makefile @@ -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 @@ -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" \ @@ -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: @@ -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"