Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a compilation of the project as a static library #549

Open
ihhub opened this issue Sep 30, 2019 · 9 comments
Open

Add a compilation of the project as a static library #549

ihhub opened this issue Sep 30, 2019 · 9 comments
Assignees
Labels
help wanted We need a help script All stuff related to scripting for CI, installation or compilation
Milestone

Comments

@ihhub
Copy link
Owner

ihhub commented Sep 30, 2019

We would like to integration continuous deployment for the project and one of the goal as of the project is to create it as a static library for end developer who doesn't have specific libraries/technologies on his/her PC. We use Travis-CI as virtual machine server to continuous integration for MacOS and Linux while AppVeyor is for Windows. We use makefile to project compilation for these platforms.
We need to add an ability to compile static library of the project which would go as a part of deployment for releases.

@ihhub ihhub added help wanted We need a help Hacktoberfest script All stuff related to scripting for CI, installation or compilation labels Sep 30, 2019
@ihhub ihhub added this to the Release milestone Sep 30, 2019
@ihhub
Copy link
Owner Author

ihhub commented Sep 30, 2019

Hi @yannlabou would you like to have a look at this? It should be interesting to implement. I can help with deployment part as I know how to do it.

@yannlabou
Copy link
Collaborator

Sounds interesting. Will look deeper at it tonight.

@ihhub
Copy link
Owner Author

ihhub commented Sep 30, 2019

👍

@ihhub
Copy link
Owner Author

ihhub commented Oct 1, 2019

@yannlabou you could have a look into this project which I maintain for check how deployment is done.

@yannlabou
Copy link
Collaborator

Which part of https://github.com/ihhub/fheroes2 should I particularly check? Further it will be better to create to separate issues for the creation of a static and a dynamic library.

@ihhub ihhub changed the title Add a compilation of the project as a static/dynamic library Add a compilation of the project as a static library Oct 1, 2019
@ihhub
Copy link
Owner Author

ihhub commented Oct 1, 2019

@yannlabou I referred this project as an example for deployment part. In .travis.yml I've added:

# blocklist
branches:
  except:
  - /^fheroes2-windows-.*$/
  - /^fheroes2-linux-.*$/
  - /^fheroes2-osx-.*$/

to do not run job on specific tags.
The this part is responsible for deployment preparation and deployment itself:

      before_deploy:
        - export TRAVIS_TAG=fheroes2-linux-sdl1-$TRAVIS_BUILD_NUMBER
        - git tag $TRAVIS_TAG
<---- HERE I create a zip archive for deployment --->
        - zip fheroes2_linux_sdl1.zip fheroes2 LICENSE script/linux/install_sdl_1.sh script/linux/install_sdl_2.sh script/demo/demo_linux.sh
      deploy:
        provider: releases
        api_key: "$GITHUB_OAUTH_TOKEN" <--- HERE I created environment variable inside Travis
        file: "fheroes2_linux_sdl1.zip"
        skip_cleanup: true
        on:
          branch: master <--- HERE we deploy only on master branch

@ihhub
Copy link
Owner Author

ihhub commented Oct 1, 2019

For appveyor.yml:

skip_tags: true

to do not build on new tags.

Prepare files for deployment (zip archive):

after_build:
  - cmd: if "%platform%"=="x86" cd C:\projects\fheroes2\Release
  - cmd: if "%platform%"=="x64" cd C:\projects\fheroes2\x64\Release
  - cmd: 7z a fheroes2.zip fheroes2.exe SDL.dll SDL_mixer.dll
  - cmd: if "%platform%"=="x86" xcopy /Y /s "fheroes2.zip" ".."
  - cmd: if "%platform%"=="x64" xcopy /Y /s "fheroes2.zip" "..\.."
  - cmd: cd C:\projects\fheroes2
  - cmd: 7z a fheroes2.zip script\demo\demo.bat LICENSE

Do deployment:

deploy:
  release: fheroes2-windows-$(appveyor_build_version)-$(platform)
  description: $(APPVEYOR_REPO_COMMIT_MESSAGE)
  provider: GitHub
  auth_token: <-- HERE this is encrypted token manually created
    secure: 0KcyoHsROl98QBsNcB+so6hegLvgWZ0R2zYammwgqdDyVXkNDejMjiDpr5sqDnx9
  artifact: /.*\.zip/ <-- HERE deploy all files with zip extension
  draft: false
  prerelease: false
  on:
    branch: master <-- HERE only master branch commits

@ihhub
Copy link
Owner Author

ihhub commented Oct 1, 2019

Moreover, I'll create a deployment account for this project soon which will be responsible for all this stuff.

@ihhub
Copy link
Owner Author

ihhub commented Oct 1, 2019

Okay, I've created a deployment account for this project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted We need a help script All stuff related to scripting for CI, installation or compilation
Projects
None yet
Development

No branches or pull requests

2 participants