From 2e17f7261206348026cf510f8b519c41a4e2e80a Mon Sep 17 00:00:00 2001 From: Perry Werneck Date: Wed, 26 Apr 2023 08:00:57 -0300 Subject: [PATCH] Starting macos bundler. --- .github/workflows/macpkg.yml | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ mac/ci-build.sh | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 87 insertions(+), 0 deletions(-) create mode 100644 .github/workflows/macpkg.yml create mode 100644 mac/ci-build.sh diff --git a/.github/workflows/macpkg.yml b/.github/workflows/macpkg.yml new file mode 100644 index 0000000..4a7f278 --- /dev/null +++ b/.github/workflows/macpkg.yml @@ -0,0 +1,50 @@ +name: Publish +on: + push: + branches: + - macos + pull_request: + branches: + - master + - develop +jobs: + macos: + name: Publish macos + runs-on: macos-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - uses: oprypin/find-latest-tag@v1 + id: gettag + with: + repository: PerryWerneck/pw3270 + sort-tags: true + releases-only: true + - name: Install Pre reqs + run: | + brew update + brew install xz automake binutils coreutils curl gettext libtool openssl pkgconfig gtk+3 + brew upgrade + - uses: robinraju/release-downloader@v1.7 + with: + repository: "PerryWerneck/lib3270" + latest: true + fileName: "macos-lib3270.tar.xz" + - uses: robinraju/release-downloader@v1.7 + with: + repository: "PerryWerneck/libv3270" + latest: true + fileName: "macos-libv3270.tar.xz" + - name: build + run: ./mac/ci-build.sh + - uses: ncipollo/release-action@v1 + with: + tag: ${{ steps.gettag.outputs.tag }} + artifacts: "macos-pw3270.tar.xz" + allowUpdates: true + draft: true + makeLatest: true + omitBody: true + omitPrereleaseDuringUpdate: true + replacesArtifacts: true + diff --git a/mac/ci-build.sh b/mac/ci-build.sh new file mode 100644 index 0000000..9c74a80 --- /dev/null +++ b/mac/ci-build.sh @@ -0,0 +1,37 @@ +#!/bin/bash + +PROJECT_NAME=$(grep AC_INIT configure.ac | cut -d[ -f2 | cut -d] -f1) +VERSION=$(grep AC_INIT configure.ac | cut -d[ -f3 | cut -d] -f1) + +unpack() { + + echo "Unpacking ${1}" + + tar -C $(brew --cellar) -Jxvf macos-${1}.tar.xz + if [ "$?" != "0" ]; then + exit -1 + fi + + brew link ${1} + if [ "$?" != "0" ]; then + exit -1 + fi + +} + +unpack lib3270 +unpack libv3270 + +./autogen.sh --prefix="/${PROJECT_NAME}/${VERSION}" +if [ "$?" != "0" ]; then + exit -1 +fi + +make all +if [ "$?" != "0" ]; then + exit -1 +fi + +make DESTDIR=.bin/package install +tar --create --xz --file=macos-${PROJECT_NAME}.tar.xz --directory=.bin/package --verbose . + -- libgit2 0.21.2