From 2cda52a5d22a8565fa36e30a5f1288e66f3fa3d0 Mon Sep 17 00:00:00 2001 From: Stef Smeets Date: Wed, 31 Jul 2024 16:30:52 +0200 Subject: [PATCH 1/6] Zip and upload SOCRATES package to artifacts --- .github/workflows/build.yml | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e80dd71..3631f67 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,10 +16,25 @@ jobs: sudo apt update sudo apt-get install libnetcdff-dev netcdf-bin gfortran gcc - - name: SOCRATES + - name: Build run: | export LD_LIBRARY_PATH="" ./configure ./build_code source set_rad_env + - name: Zip + run: | + zip -r SOCRATES-${{ runner.os }} . + + - name: Upload binary + uses: actions/upload-artifact@v2 + with: + name: socrates-${{ runner.os }}.zip + path: socrates-${{ runner.os }}.zip + + # - name: Release + # uses: softprops/action-gh-release@v1 + # if: startsWith(github.ref, 'refs/tags/') + # with: + # files: tetgen-${{ runner.os }}.zip From efcab6069eafa8e569105116e3fefadd327fc438 Mon Sep 17 00:00:00 2001 From: Stef Smeets Date: Wed, 31 Jul 2024 16:44:28 +0200 Subject: [PATCH 2/6] Run on PR --- .github/workflows/build.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3631f67..a531e40 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,7 +2,11 @@ name: Compile SOCRATES on: push: - branches: [main] + branches: + - main + pull_request: + branches: + - main jobs: install: @@ -37,4 +41,4 @@ jobs: # uses: softprops/action-gh-release@v1 # if: startsWith(github.ref, 'refs/tags/') # with: - # files: tetgen-${{ runner.os }}.zip + # files: socrates-${{ runner.os }}.zip From 3d4e460d6af3b4ffd1642314dd618dbee9fad3ea Mon Sep 17 00:00:00 2001 From: Stef Smeets Date: Wed, 31 Jul 2024 16:52:26 +0200 Subject: [PATCH 3/6] Make sure paths match --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a531e40..ee2b742 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -29,7 +29,7 @@ jobs: - name: Zip run: | - zip -r SOCRATES-${{ runner.os }} . + zip -r socrates-${{ runner.os }} . - name: Upload binary uses: actions/upload-artifact@v2 From 990c0c57367c7427c121d478e7b04c903e88e7ae Mon Sep 17 00:00:00 2001 From: Stef Smeets Date: Wed, 31 Jul 2024 16:55:41 +0200 Subject: [PATCH 4/6] Use current version of action --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ee2b742..5c6a1d0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -32,7 +32,7 @@ jobs: zip -r socrates-${{ runner.os }} . - name: Upload binary - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: socrates-${{ runner.os }}.zip path: socrates-${{ runner.os }}.zip From b2fb6071bbcd511cc24b072c369370af7d993b28 Mon Sep 17 00:00:00 2001 From: Stef Smeets Date: Wed, 31 Jul 2024 17:01:13 +0200 Subject: [PATCH 5/6] Enable release on tagged version --- .github/workflows/build.yml | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5c6a1d0..39bd0c6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,9 +4,6 @@ on: push: branches: - main - pull_request: - branches: - - main jobs: install: @@ -37,8 +34,9 @@ jobs: name: socrates-${{ runner.os }}.zip path: socrates-${{ runner.os }}.zip - # - name: Release - # uses: softprops/action-gh-release@v1 - # if: startsWith(github.ref, 'refs/tags/') - # with: - # files: socrates-${{ runner.os }}.zip + - name: Release + uses: softprops/action-gh-release@v2 + if: startsWith(github.ref, 'refs/tags/') + with: + files: socrates-${{ runner.os }}.zip + body_path: version From 0144f781fbccffa2f9b962d1b365477cbf0d7735 Mon Sep 17 00:00:00 2001 From: Stef Smeets Date: Thu, 1 Aug 2024 09:37:53 +0200 Subject: [PATCH 6/6] Add readme with workflow details --- .github/workflows/README.md | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 .github/workflows/README.md diff --git a/.github/workflows/README.md b/.github/workflows/README.md new file mode 100644 index 0000000..7252c3a --- /dev/null +++ b/.github/workflows/README.md @@ -0,0 +1,9 @@ +The build workflow compiles the code and makes the zip file in the [Action artifacts](https://github.com/FormingWorlds/SOCRATES/actions). Any push to the master branch will trigger the workflow to compile the code + +How to make a release: + +1. Tag a version of the code, e.g. `git tag 1.0.0` +2. Push the tag, `git push origin tag 1.0.0` +3. The [action-gh-release action](https://github.com/softprops/action-gh-release) detects a tagged commit and makes a [release](https://github.com/FormingWorlds/SOCRATES/releases) +4. The release contains a zip file with the compiled code +5. Update the release notes if necessary