-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #28 from PerryWerneck/master
Adding github actions to publish mingw and msvc packages.
- Loading branch information
Showing
3 changed files
with
152 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
|
||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters