Skip to content

Commit

Permalink
Merge pull request #28 from PerryWerneck/master
Browse files Browse the repository at this point in the history
Adding github actions to publish mingw and msvc packages.
  • Loading branch information
Thomas-Sparber authored Jul 13, 2023
2 parents 564bbbb + bad10cc commit 2cc7f51
Show file tree
Hide file tree
Showing 3 changed files with 152 additions and 0 deletions.
63 changes: 63 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Publish
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
msys2-mingw64:
name: Publish for MinGW 64
runs-on: windows-latest
defaults:
run:
shell: msys2 {0}
steps:
- uses: actions/checkout@v3
- uses: msys2/setup-msys2@v2
with:
msystem: mingw64
update: true
install: dos2unix mingw-w64-x86_64-gcc automake autoconf make git
- name: CI-Build
run: |
dos2unix PKGBUILD.mingw
makepkg BUILDDIR=/tmp/pkg -f -p PKGBUILD.mingw
- uses: ncipollo/release-action@v1
with:
tag: "1.0"
artifacts: "*.pkg.tar.zst"
allowUpdates: true
draft: false
makeLatest: true
omitBody: true
omitPrereleaseDuringUpdate: true
replacesArtifacts: true
msvc-pack:
runs-on: windows-latest
name: Publish MSVC 64
steps:
- uses: actions/checkout@v3
- uses: ilammy/[email protected]
- name: Build
run: |
cl /c /nologo /Ox /W3 /GL /MD /I".\include" /EHsc src/wmi.cpp src/wmiresult.cpp
mkdir wmi
mkdir wmi\lib
lib /nologo /out:wmi/lib/wmi.lib wmi.obj wmiresult.obj
mkdir wmi\include
xcopy /Y /s include\* wmi\include
- name: pack
run: 7z a msvc-wmi-x86_64.zip .\wmi
- uses: ncipollo/release-action@v1
with:
tag: "1.0"
artifacts: "*wmi*.zip"
allowUpdates: true
draft: false
makeLatest: true
omitBody: true
omitPrereleaseDuringUpdate: true
replacesArtifacts: true

88 changes: 88 additions & 0 deletions PKGBUILD.mingw
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# Maintainer: Perry Werneck <[email protected]>
# References: https://www.msys2.org/wiki/Creating-Packages/

# Maintainer: Perry Werneck <[email protected]>
# References: https://www.msys2.org/wiki/Creating-Packages/

# SPDX-License-Identifier: LGPL-3.0-or-later

# Copyright (C) 2023 Perry Werneck <[email protected]>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.

_realname=wmi++

pkgname=${MINGW_PACKAGE_PREFIX}-${_realname}
source=()

pkgver=1.0
pkgrel=0
pkgdesc="A very simple library written in C++ to execute WMI queries"
url="https://github.com/Thomas-Sparber/wmi"
arch=(i686 x86_64)
license=(MIT)

makedepends=(autoconf automake make ${MINGW_PACKAGE_PREFIX}-gcc)
checkdepends=()

provides=($pkgname)
conflicts=($pkgname)

prepare() {
rm -fr "$srcdir/$pkgname"
ln -snf "$startdir" "$srcdir/$pkgname"
}

build() {
cd $pkgname
make all
}

package() {

cd $pkgname

install \
-Dm644 \
"LICENSE" \
${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/LICENSE

install \
-Dm755 \
wmi.dll \
${pkgdir}${MINGW_PREFIX}/bin/wmi.dll

install \
-Dm755 \
wmi.dll \
${pkgdir}${MINGW_PREFIX}/lib/wmi.dll

install \
-Dm755 \
diaa_sami_comsupp.dll \
${pkgdir}${MINGW_PREFIX}/bin/iaa_sami_comsupp.dll

mkdir -p ${pkgdir}${MINGW_PREFIX}/include/wmi
chmod 755 ${pkgdir}${MINGW_PREFIX}/include/wmi

install \
-Dm755 \
include/* \
${pkgdir}${MINGW_PREFIX}/include/wmi

mkdir -p ${pkgdir}${MINGW_PREFIX}/lib
ar rcs ${pkgdir}${MINGW_PREFIX}/lib/wmi.static.a bin/wmi.o bin/wmiresult.o

}

1 change: 1 addition & 0 deletions include/wmiresult.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include <map>
#include <string>
#include <vector>
#include <cstdint> // Defines uint64_t

namespace Wmi
{
Expand Down

0 comments on commit 2cc7f51

Please sign in to comment.