From 3b0dc8729c659576ca7e077ab226daee97edba99 Mon Sep 17 00:00:00 2001 From: Perry Werneck Date: Sun, 26 Mar 2023 00:10:47 -0300 Subject: [PATCH] Working on macos action. --- .github/workflows/macos.yml | 40 ++++++++++++++++++++++++++++++++++++++++ .github/workflows/msys2.yml | 7 ++++++- mac/ci-build.sh | 31 +++++++++++++++++++++++++++++++ rpm/_servicedata | 4 ++++ 4 files changed, 81 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/macos.yml create mode 100755 mac/ci-build.sh create mode 100644 rpm/_servicedata diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml new file mode 100644 index 0000000..411ca1d --- /dev/null +++ b/.github/workflows/macos.yml @@ -0,0 +1,40 @@ +name: MacOS +on: + push: + branches: + [ develop ] +jobs: + macos-build: + name: Build for mac + runs-on: macos-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - uses: oprypin/find-latest-tag@v1 + id: gettag + with: + repository: PerryWerneck/lib3270 + 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" + - name: build + run: ./mac/ci-build.sh + - uses: ncipollo/release-action@v1 + with: + tag: ${{ steps.gettag.outputs.tag }} + artifacts: "macos-libv3270.tar.xz" + allowUpdates: true + draft: false + makeLatest: true + omitBody: true + omitPrereleaseDuringUpdate: true + replacesArtifacts: true + diff --git a/.github/workflows/msys2.yml b/.github/workflows/msys2.yml index 57d6a9f..3fdaffe 100644 --- a/.github/workflows/msys2.yml +++ b/.github/workflows/msys2.yml @@ -14,6 +14,11 @@ jobs: shell: msys2 {0} steps: - uses: actions/checkout@v3 + - uses: oprypin/find-latest-tag@v1 + id: gettag + with: + repository: PerryWerneck/lib3270 + releases-only: true - uses: msys2/setup-msys2@v2 with: msystem: mingw64 @@ -29,7 +34,7 @@ jobs: ./win/ci-build.sh - uses: ncipollo/release-action@v1 with: - tag: 5.4 + tag: ${{ steps.gettag.outputs.tag }} artifacts: "mingw-libv3270.tar.xz" allowUpdates: true draft: false diff --git a/mac/ci-build.sh b/mac/ci-build.sh new file mode 100755 index 0000000..2cc9599 --- /dev/null +++ b/mac/ci-build.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +export PKG_CONFIG_PATH="$(brew --prefix curl)/lib/pkgconfig:$(brew --prefix openssl)/lib/pkgconfig" + +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) + +echo "Unpacking lib3270" +tar -C $(brew --cellar) -Jxvf mingw-lib3270.tar.xz +if [ "$?" != "0" ]; then + exit -1 +fi + +brew link lib3270 +if [ "$?" != "0" ]; then + exit -1 +fi + +./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 . + diff --git a/rpm/_servicedata b/rpm/_servicedata new file mode 100644 index 0000000..2b4608a --- /dev/null +++ b/rpm/_servicedata @@ -0,0 +1,4 @@ + + + https://github.com/PerryWerneck/libv3270.git + 1da277294f1cec4dd0b9f3a2a4e04f9bdee1c85c \ No newline at end of file -- libgit2 0.21.2