Skip to content

Commit

Permalink
package windows
Browse files Browse the repository at this point in the history
package is made using msys2 in CI

Signed-off-by: Matthias Gatto <[email protected]>
  • Loading branch information
outscale-mgo committed Feb 6, 2023
1 parent c81b251 commit d9cbdd7
Show file tree
Hide file tree
Showing 6 changed files with 65 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .github/script/build-win.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

CMAKE_ARG="-G MSYS Makefiles" make
58 changes: 58 additions & 0 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Package Application on Mingw64

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2

- uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
install: >-
git
base-devel
zip
pacboy:
gcc
cmake
openssl
json-c
curl

- shell: msys2 {0}
run: |
git submodule update --init
.github/script/build-win.sh
mkdir oapi-pkg
LD_LIBRARY_PATH="$PWD" ./cp-lib.sh oapi-cli oapi-pkg/
cp oapi-cli.exe oapi-pkg/
zip -r oapi-cli-x86_64.zip oapi-pkg/
./oapi-pkg/oapi-cli.exe --insecure ReadRegions | grep api.eu-west-2.outscale.com
env:
OSC_ACCESS_KEY: ${{secrets.OSC_ACCESS_KEY}}
OSC_SECRET_KEY: ${{secrets.OSC_SECRET_KEY}}
OSC_REGION: ${{secrets.OSC_REGION}}
- name: Upload artifacts
uses: actions/upload-artifact@v2
if: ${{ github.event_name != 'push' }}
with:
name: oapi-cli-win
path: |
oapi-cli-x86_64.zip
- name: upload nightly
uses: "marvinpinto/action-automatic-releases@latest"
if: ${{ github.event_name == 'push' }}
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: true
automatic_release_tag: "nightly-windows"
title: "Windows Development Build"
files: |
oapi-cli-x86_64.zip
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "COGNAC"]
path = COGNAC
url = https://github.com/outscale-mgo/COGNAC.git
url = https://github.com/outscale/COGNAC.git
2 changes: 1 addition & 1 deletion COGNAC
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ json-c/.git:
json-c-build/libjson-c.a: json-c/.git
rm -rvf ./json-c-build
mkdir json-c-build
cd json-c-build && cmake ../json-c/ # might need to be replace by cmake3
cd json-c-build && cmake ../json-c/ "$${CMAKE_ARG}" # might need to be replace by cmake3
make -C json-c-build json-c-static

main-helper.h:
Expand Down
2 changes: 1 addition & 1 deletion main.c
Original file line number Diff line number Diff line change
Expand Up @@ -8181,7 +8181,7 @@ int main(int ac, char **av)
char *help_appent = getenv("COGNAC_HELP_APPEND");
unsigned int flag = 0;
unsigned int program_flag = 0;
char *program_name = rindex(av[0], '/');
char *program_name = strrchr(av[0], '/');
char *profile = NULL;
int ret = 1;

Expand Down

0 comments on commit d9cbdd7

Please sign in to comment.