Skip to content

Commit

Permalink
Release | Github action for automated release
Browse files Browse the repository at this point in the history
  • Loading branch information
josemamontes-elemwave committed May 22, 2024
1 parent c1bd534 commit c63bffe
Show file tree
Hide file tree
Showing 3 changed files with 129 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/create-dist.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
md "dist\"
xcopy "build\bin\Release\" "dist\" /e
125 changes: 125 additions & 0 deletions .github/workflows/windows-automated-releases.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
name: "Windows-automated-releases"

on:
push:
branches:
- master
- feature/automate-release

env:
PULMTLN_TOP_DIR: pulmtln
MFEM_TOP_DIR: mfem


jobs:
builds-and-tests:
strategy:
matrix:
os: [windows-latest]
target: [opt]

name: ${{ matrix.os }}-${{ matrix.target }}

runs-on: ${{ matrix.os }}

steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.11.0
with:
access_token: ${{ github.token }}

- name: checkout PULMTLN
uses: actions/checkout@v3
with:
path: ${{ env.PULMTLN_TOP_DIR }}
ssh-key: ${{secrets.PULMTLN_SSH_KEY}}

- name: getcmake
uses: lukka/get-cmake@latest

- name: Setup vcpkg (it does not install any package yet)
uses: lukka/run-vcpkg@v11
with:
vcpkgGitCommitId: 42bb0d9e8d4cf33485afb9ee2229150f79f61a1f
vcpkgJsonGlob: 'pulmtln/vcpkg.json'

- name: cache MFEM
uses: actions/cache@v3
id: mfem-cache
with:
path: ${{ env.MFEM_TOP_DIR }}
key: mfem-build-windows-opt

- name: checkout MFEM
if: steps.mfem-cache.outputs.cache-hit != 'true'
uses: actions/checkout@v3
with:
repository: opensemba/mfem
path: ${{ env.MFEM_TOP_DIR }}

- name: build MFEM
if: steps.mfem-cache.outputs.cache-hit != 'true'
uses: mfem/github-actions/build-mfem@v2.4
env:
HYPRE_TOP_DIR: hypre-2.19.0
METIS_TOP_DIR: metis-4.0.3
VCPKG_DEFAULT_BINARY_CACHE: ${{ github.workspace }}/vcpkg_cache
with:
os: windows-latest
target: opt
mpi: seq
build-system: cmake
hypre-dir: ${{ env.HYPRE_TOP_DIR }}
metis-dir: ${{ env.METIS_TOP_DIR }}
mfem-dir: ${{ env.MFEM_TOP_DIR }}

# - name: Setup tmate session
# uses: mxschmitt/action-tmate@v3

- name: Configuring PULMTLN
env:
MFEM_PACKAGE: ${{ github.workspace }}/${{env.MFEM_TOP_DIR}}/build
run: |
cmake --preset "msbuild-vcpkg" -S pulmtln -B pulmtln/build
- name: Building PULMTLN
run: |
cmake --build pulmtln/build/ --config Release
# - name: Configuring and building PULMTLN
# uses: lukka/run-cmake@v10
# id: runcmake

# with:
# cmakeListsTxtPath: '${{ github.workspace }}/pulmtln/CMakeLists.txt'
# configurePreset: 'msbuild-vcpkg'
# configurePresetAdditionalArgs: '[`-DCMAKE_PREFIX_PATH=../mfem`]'
# buildPreset: 'msbuild-vcpkg'
# buildPresetAdditionalArgs: '[`--config Release`]'

- name: test PULMTLN
run: cd pulmtln && build/bin/Release/pulmtln_tests.exe

- name: Get current date
id: date
run: echo "::set-output name=date::$(date +'%Y-%m-%d')"

- name: Create dist folder
shell: bash
run: |
.github/workflows/create-dist.bat
- name: Create .tar file
run: |
tar -czvf pulmtln-windows.tar.gz dist/*
- name: Generating release
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "latest-windows-pulmtln"
prerelease: false
title: "${{ steps.date.outputs.date }} Windows Pulmtln"
files: |
pulmtln-windows.tar.gz
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ Using ```CMAKE_FIND_USE_PACKAGE_REGISTRY=FALSE``` warranties that no previously
Once compiled, test cases can be launched from the project root folder, with

```shell
<build folder>/bin/pulmtln_tests.exe
<build folder>/bin/Release/pulmtln_tests.exe
```

Most cases will store results in the `Results` folder.
Expand Down Expand Up @@ -127,4 +127,4 @@ Below there is an example of the electric fields for the `five_wires` case visua
This project is funded by the following grants:

- HECATE - Hybrid ElectriC regional Aircraft distribution TEchnologies. HE-HORIZON-JU-Clean-Aviation-2022-01. European Union.
- ESAMA - Métodos numéricos avanzados para el análisis de materiales eléctricos y magnéticos en aplicaciones aerospaciales. PID2022-137495OB-C31. Spain.
- ESAMA - M�todos num�ricos avanzados para el an�lisis de materiales el�ctricos y magn�ticos en aplicaciones aerospaciales. PID2022-137495OB-C31. Spain.

0 comments on commit c63bffe

Please sign in to comment.